/* ====================================
   SISTEMA DE CALIFICACIONES HORUS
   Modern Professional Design 2025
   ==================================== */

/* ============= CSS VARIABLES ============= */
:root {
    /* Light Mode Colors */
    --bg-gradient-1: #667eea;
    --bg-gradient-2: #764ba2;
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-overlay: rgba(0, 0, 0, 0.35);
    
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-inverse: #ffffff;
    
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gold: #f6ad55;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    --border-focus: #667eea;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --bg-gradient-1: #4c1d95;
    --bg-gradient-2: #5b21b6;
    --bg-body: #0f0f23;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --text-inverse: #1a202c;
    
    --accent-primary: #9f7aea;
    --accent-secondary: #b794f4;
    --accent-gold: #f6ad55;
    
    --border-light: #2d3748;
    --border-medium: #4a5568;
    --border-focus: #9f7aea;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(159, 122, 234, 0.4);
}

/* ============= RESET ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============= BODY ============= */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    background-image: url("../img/prepa1-daniel.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============= THEME TOGGLE ============= */
.theme-toggle {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.theme-toggle:active {
    transform: translateY(-1px) scale(1);
}

.theme-icon {
    font-size: 28px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: absolute;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ============= BACKGROUND OVERLAY ============= */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px) saturate(150%);
    z-index: 0;
    transition: background 0.4s ease;
}

/* ============= SPLIT CONTAINER ============= */
.split-container {
    display: flex;
    width: 100%;
    max-width: 1300px;
    min-height: 600px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 10;
    border: 1px solid var(--border-light);
    transition: all 0.4s ease;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= LEFT PANEL ============= */
.left-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 50px;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.left-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}

.left-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
    text-align: center;
    animation: fadeInLeft 0.8s ease-out 0.2s both;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.left-panel h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--text-inverse);
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -1px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.left-panel p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 40px;
    font-weight: 400;
}

.feature-list {
    text-align: left;
    margin-top: 48px;
}

.feature-list ul {
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    font-size: 1.05rem;
    color: var(--text-inverse);
}

.feature-list li:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feature-list i {
    margin-right: 18px;
    font-size: 1.5rem;
    color: var(--accent-gold);
    min-width: 30px;
}

/* ============= RIGHT PANEL ============= */
.right-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    position: relative;
    background: var(--bg-card);
    transition: background 0.4s ease;
}

/* ============= FORM CONTAINERS ============= */
.form-container {
    width: 100%;
    max-width: 450px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
}

.login-container {
    opacity: 1;
    transform: translateX(0);
}

.forgot-password-container {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.forgot-password-container.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.login-container.inactive {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

/* ============= LOGIN FORM ============= */
.login {
    width: 100%;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= FORM TITLE ============= */
.head,
.form-title {
    margin-bottom: 40px;
    text-align: center;
}

h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
}

.subtitle,
.form-title p {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    transition: color 0.3s ease;
}

/* ============= LOGO ============= */
.logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: cover;
}

.logo img:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
}

/* ============= INPUT GROUPS ============= */
.input-group {
    margin-bottom: 28px;
    position: relative;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    font-size: 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

input::placeholder {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

input:hover {
    border-color: var(--border-medium);
}

input:focus {
    border-color: var(--border-focus);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

[data-theme="dark"] input:focus {
    box-shadow: 0 0 0 4px rgba(159, 122, 234, 0.15);
}

input[type="password"] {
    letter-spacing: 0.1em;
}

/* ============= INPUT ICONS ============= */
.input-icon {
    position: absolute;
    left: 18px;
    top: 48px;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
}

input:focus ~ .input-icon {
    color: var(--accent-primary);
    transform: scale(1.15);
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 48px;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--accent-primary);
    transform: scale(1.15);
}

/* ============= SUBMIT BUTTON ============= */
.submit-btn {
    width: 100%;
    padding: 17px 32px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-inverse);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* ============= FORM FOOTER ============= */
.form-footer {
    text-align: center;
    margin-top: 32px;
}

.forgot-password-link,
.back-to-login {
    display: inline-block;
    margin-top: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 2px;
}

.forgot-password-link::after,
.back-to-login::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.forgot-password-link:hover::after,
.back-to-login:hover::after {
    width: 100%;
}

.forgot-password-link:hover,
.back-to-login:hover {
    color: var(--accent-secondary);
}

/* ============= HIDE OLD ELEMENTS ============= */
.icon-user,
.icon-lock {
    display: none;
}

/* ============= RESPONSIVE ============= */

/* Mobile */
@media (max-width: 748px) {
    body {
        padding: 10px;
        background-image: none;
    }
    
    .theme-toggle {
        width: 52px;
        height: 52px;
        top: 20px;
        left: 20px;
    }
    
    .theme-icon {
        font-size: 24px;
    }
    
    .split-container {
        flex-direction: column;
        max-height: none;
        border-radius: var(--radius-lg);
    }
    
    .left-panel {
        display: none;
    }
    
    .right-panel {
        padding: 40px 24px;
    }
    
    .form-container {
        position: relative !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }
    
    .forgot-password-container {
        display: none;
    }
    
    .forgot-password-container.active {
        display: block;
    }
    
    .login-container.inactive {
        display: none;
    }
    
    h2 {
        font-size: 1.875rem;
    }
    
    .left-panel h1 {
        font-size: 2.5rem;
    }
    
    input {
        padding: 14px 16px 14px 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .input-icon {
        top: 44px;
    }
    
    .toggle-password {
        top: 44px;
    }
    
    .submit-btn {
        padding: 15px 28px;
    }
}

/* Tablet */
@media (min-width: 749px) and (max-width: 1023px) {
    .split-container {
        max-width: 900px;
    }
    
    .left-panel {
        padding: 40px 30px;
    }
    
    .left-panel h1 {
        font-size: 2.5rem;
    }
    
    .right-panel {
        padding: 40px 30px;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .split-container {
        max-width: 1400px;
    }
    
    .left-panel h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}