/* ==========================================
   1. VARIABLES CSS Y RESET GLOBAL
   ========================================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --emerald: #10b981;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 16px;
    --shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

/* ==========================================
   2. ESTRUCTURA Y CONTENEDOR PRINCIPAL
   ========================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
    background: radial-gradient(circle at top, #eff6ff 0%, var(--bg-light) 70%);
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-3px);
}

.auth-card {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 400px;
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    margin: 0 auto;
}

/* ==========================================
   3. BRANDING Y ENCABEZADO
   ========================================== */
.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-link {
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.logo-icon {
    color: var(--emerald); 
}

.brand-creative {
    color: var(--primary); 
}

.brand-art {
    color: var(--accent); 
}

.auth-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 0.4rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================
   4. SELECTOR ESTILO PESTAÑAS (TABS ESTUDIANTE / DOCENTE)
   ========================================== */
.role-tabs {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.75rem;
}

.role-tabs input[type="radio"] {
    display: none;
}

.tab-option {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease, font-weight 0.2s ease;
    user-select: none;
}

.tab-option:hover {
    color: var(--secondary);
}

.role-tabs input[type="radio"]:checked + .tab-option {
    color: var(--secondary);
    font-weight: 700;
}

.role-tabs input[type="radio"]:checked + .tab-option::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2.5px;
    background-color: var(--primary);
    border-radius: 2px 2px 0 0;
}

/* ==========================================
   5. TRANSICIÓN A MODO ADMINISTRADOR
   ========================================== */
.admin-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f5f9;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.admin-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-back-tabs {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-back-tabs:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==========================================
   6. FORMULARIO E INPUTS
   ========================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary);
}

.forgot-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

.form-group input[type="email"],
.form-group input[type="password"],
.password-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-group input:focus,
.password-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

/* Contraseña con ojito */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 2.75rem !important;
}

.toggle-password-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 2;
}

.toggle-password-btn:hover {
    color: var(--primary);
}

/* Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
    user-select: none;
}

.remember-me input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Botones */
.btn {
    padding: 0.8rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-admin {
    background-color: var(--secondary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    margin-top: 0.5rem;
}

.btn-admin:hover {
    background-color: #020617;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

/* ==========================================
   7. FOOTER / CRÉDITOS
   ========================================== */
.auth-footer {
    text-align: center;
    margin-top: 1.8rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.credits-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.credits-text strong {
    color: var(--secondary);
}

.copyright-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    line-height: 1.4;
}

.copyright-text strong {
    color: var(--secondary);
}

/* ==========================================
   8. ADAPTACIÓN RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    .auth-wrapper {
        padding: 1rem 0.75rem;
    }

    .auth-card {
        padding: 1.5rem 1.15rem;
        border-radius: 14px;
    }

    .logo-link {
        font-size: 1.35rem;
    }

    .auth-header h2 {
        font-size: 1.15rem;
    }

    .tab-option {
        font-size: 0.88rem;
        padding: 0.55rem 0;
    }
}