@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d47a1;
    --primary-light: #5472d3;
    --primary-dark: #002171;
    --secondary-color: #00bfa5;
    --secondary-dark: #008e76;
    --bg-gradient-start: #f4f7f6;
    --bg-gradient-end: #e0eaf5;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Background animated circles for premium feel */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
}

body::before {
    width: 400px;
    height: 400px;
    background: rgba(13, 71, 161, 0.2);
    top: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite alternate;
}

body::after {
    width: 300px;
    height: 300px;
    background: rgba(0, 191, 165, 0.2);
    bottom: -50px;
    right: -50px;
    animation: float 10s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(50px) scale(1.1); }
}

/* Glassmorphism Container */
.login-container {
    width: 100%;
    max-width: 1100px;
    min-height: 650px;
    margin: auto;
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Left Panel */
.left-panel {
    flex: 1.2; /* Hacerlo un poco más grande */
    background: linear-gradient(135deg, #4fb2f3 0%, var(--primary-dark) 100%);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    top: -50%;
    left: -50%;
    animation: auraRotate 20s linear infinite;
}

@keyframes auraRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.brand-logo-img {
    width: 320px; /* Un poco más grande como solicitaste anteriormente */
    height: auto;
    z-index: 1;
    filter: brightness(0) invert(1);
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0); }
}

.left-panel h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    z-index: 1;
}

/* Right Panel */
.right-panel {
    flex: 1;
    padding: 70px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
}

.auth-card h2 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1rem;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color var(--transition-speed);
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-speed);
}

.input-group input:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(84, 114, 211, 0.1);
}

.input-group input:focus + i,
.input-group input:not(:placeholder-shown) + i {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 71, 161, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Alert Messages */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: none;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

/* Footer Credit */
.developer-credit {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    z-index: 1;
}

.developer-credit span {
    font-weight: 600;
    color: white;
}

/* Variant for dashboards (gray/black) */
.developer-credit.dashboard {
    position: static;
    margin-top: 40px;
    color: var(--text-secondary);
    padding: 0;
}

.developer-credit.dashboard span {
    color: var(--text-primary);
}

/* Dashboard Layout Overrides (For dr & secretaria HTMLs) */
.dashboard-container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: var(--glass-bg);
    padding: 20px 30px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.logout-btn {
    background: transparent;
    border: 2px solid var(--error-color);
    color: var(--error-color);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--error-color);
    color: white;
}

/* Dashboard Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.dashboard-card {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    background: white;
}

/* Sophisticated Icon Wrapper */
.icon-box {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.05) 0%, rgba(13, 71, 161, 0.1) 100%);
    color: var(--primary-color);
    font-size: 2rem;
    box-shadow: inset 0 0 0 1px rgba(13, 71, 161, 0.05);
}

/* Secondary (Secretaria) icons */
.icon-box.secondary {
    background: linear-gradient(135deg, rgba(0, 191, 165, 0.05) 0%, rgba(0, 191, 165, 0.1) 100%);
    color: var(--secondary-color);
    box-shadow: inset 0 0 0 1px rgba(0, 191, 165, 0.05);
}

.dashboard-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 10px 20px rgba(13, 71, 161, 0.2);
}

.dashboard-card:hover .icon-box.secondary {
    background: var(--secondary-color);
    box-shadow: 0 10px 20px rgba(0, 191, 165, 0.2);
}

.dashboard-card h3 {
    color: var(--primary-dark);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.dashboard-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* =======================================
   MODAL STYLES
   ======================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--error-color);
}

.modal-options {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.modal-btn {
    flex: 1;
    padding: 25px 20px;
    border: 2px solid rgba(0,0,0,0.05);
    background: #fafafa;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.modal-btn i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.modal-btn:hover {
    border-color: var(--primary-color);
    background: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(13, 71, 161, 0.1);
}

/* Responsiveness */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        margin: 20px;
        max-width: 100%;
    }
    
    .left-panel {
        padding: 30px 20px;
    }
    
    .right-panel {
        padding: 40px 30px;
    }

    .modal-options {
        flex-direction: column;
    }
}

