/* Página de bienvenida (index.php): pantalla de accesos e inicio de sesión.
   Basada en el diseño de INFO/bienvenidav1.txt (glassmorphism, título con
   degradado y botones de acceso tipo píldora) con modo claro y oscuro. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modo oscuro */
    --bg-gradient-start: #0a1636;
    --bg-gradient-end: #030617;
    --card-bg: rgba(10, 20, 40, 0.72);
    --card-border: rgba(0, 123, 255, 0.22);
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    --franja-bg: rgba(0, 0, 0, 0.18);
    --input-bg: rgba(20, 30, 55, 0.6);
    --input-border: rgba(0, 123, 255, 0.3);
    --label-color: #a0c0e0;
    --text-color: #ffffff;
    --link-color: #00d4ff;
    --link-hover: #ffffff;
    --modal-bg: linear-gradient(135deg, rgba(15, 25, 45, 0.95), rgba(5, 10, 25, 0.98));
    --modal-text: #c0d0e8;
    --particle-opacity: 0.35;
    --orbe-opacidad: 0.55;
    --cuadricula: rgba(0, 160, 255, 0.07);
    --feature-bg: rgba(0, 123, 255, 0.16);
    --feature-icon: #5cc8ff;
    --input-focus-effect: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

body.light {
    --bg-gradient-start: #f0f9ff;
    --bg-gradient-end: #d9e6f5;
    --card-bg: rgba(255, 255, 255, 0.82);
    --card-border: rgba(0, 123, 255, 0.2);
    --card-shadow: 0 20px 50px rgba(15, 40, 80, 0.12);
    --franja-bg: rgba(255, 255, 255, 0.45);
    --input-bg: rgba(255, 255, 255, 0.92);
    --input-border: rgba(0, 123, 255, 0.3);
    --label-color: #1e3a5f;
    --text-color: #1e2a3a;
    --link-color: #007bff;
    --link-hover: #0056b3;
    --modal-bg: #ffffff;
    --modal-text: #4b5563;
    --particle-opacity: 0.45;
    --orbe-opacidad: 0.35;
    --cuadricula: rgba(0, 86, 179, 0.06);
    --feature-bg: rgba(0, 123, 255, 0.1);
    --feature-icon: #0069d9;
    --input-focus-effect: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at 20% 50%, var(--bg-gradient-start), var(--bg-gradient-end));
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

html {
    background: #030617;
}

html:has(body.light) {
    background: #d9e6f5;
}

[hidden] {
    display: none !important;
}

/* ---------- Fondo animado ---------- */
.bv-fondo {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bv-orbe {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: var(--orbe-opacidad);
    transition: opacity 0.4s ease;
}

.bv-orbe-1 {
    width: 520px;
    height: 520px;
    top: -140px;
    left: -120px;
    background: radial-gradient(circle, #007bff 0%, rgba(0, 123, 255, 0) 70%);
    animation: orbe1 18s ease-in-out infinite alternate;
}

.bv-orbe-2 {
    width: 460px;
    height: 460px;
    bottom: -160px;
    right: -100px;
    background: radial-gradient(circle, #00d4ff 0%, rgba(0, 212, 255, 0) 70%);
    animation: orbe2 22s ease-in-out infinite alternate;
}

.bv-orbe-3 {
    width: 360px;
    height: 360px;
    top: 40%;
    left: 45%;
    background: radial-gradient(circle, #1f3b5b 0%, rgba(31, 59, 91, 0) 70%);
    animation: orbe3 26s ease-in-out infinite alternate;
}

body.light .bv-orbe-3 {
    background: radial-gradient(circle, #8ec5ff 0%, rgba(142, 197, 255, 0) 70%);
}

@keyframes orbe1 {
    to { transform: translate(180px, 120px) scale(1.15); }
}

@keyframes orbe2 {
    to { transform: translate(-200px, -140px) scale(1.1); }
}

@keyframes orbe3 {
    to { transform: translate(-160px, 90px) scale(0.9); }
}

.bv-cuadricula {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--cuadricula) 1px, transparent 1px),
        linear-gradient(90deg, var(--cuadricula) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.bv-particulas {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% + 200px);
    height: calc(100% + 200px);
    background-image:
        radial-gradient(2px 2px at 20px 30px, #00d4ff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40px 70px, #007bff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 80px 120px, #00d4ff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 160px 40px, #007bff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 120px 170px, #5cc8ff, rgba(0, 0, 0, 0));
    background-size: 200px 200px;
    opacity: var(--particle-opacity);
    animation: drift 20s linear infinite;
    transition: opacity 0.4s ease;
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(-200px, -200px); }
}

@media (prefers-reduced-motion: reduce) {
    .bv-orbe, .bv-particulas, .welcome-title::after, .institution::before {
        animation: none !important;
    }
}

/* ---------- Botón de tema ---------- */
.theme-toggle {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--text-color);
}

body:not(.light) .theme-toggle {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 123, 255, 0.5);
}

.theme-toggle i {
    font-size: 17px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* ---------- Pantalla de bienvenida ---------- */
.welcome-screen {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: floatIn 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes floatIn {
    0% { opacity: 0; transform: translateY(40px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-header {
    padding: 16px 5%;
    padding-right: 190px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    background: var(--franja-bg);
    backdrop-filter: blur(10px);
}

.welcome-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.institution {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-color);
}

.institution::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: #00d4ff;
    box-shadow: 0 0 10px #00d4ff;
    animation: pulseDot 2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.subtitle {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--label-color);
}

.welcome-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 48px 8%;
    gap: 60px;
}

.welcome-content {
    flex: 1;
    max-width: 700px;
}

.welcome-brand {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 26px;
}

.welcome-logo {
    width: 128px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 0 14px rgba(0, 123, 255, 0.35));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.welcome-logo:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

.welcome-title {
    font-size: 46px;
    font-weight: 800;
    line-height: 1.15;
    background: linear-gradient(135deg, #ffffff, #00d4ff, #007bff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

body.light .welcome-title {
    background: linear-gradient(135deg, #0056b3, #007bff, #00a3ff);
    -webkit-background-clip: text;
    background-clip: text;
}

.welcome-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    margin-top: 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, #007bff, #00d4ff, transparent);
    animation: expandLine 3s ease-in-out infinite alternate;
}

@keyframes expandLine {
    from { width: 80px; opacity: 0.7; }
    to { width: 160px; opacity: 1; }
}

.welcome-description {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--text-color);
    text-align: justify;
    margin-bottom: 26px;
}

.welcome-features {
    list-style: none;
    display: grid;
    gap: 12px;
}

.welcome-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-color);
}

.welcome-features i {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--feature-bg);
    border: 1px solid var(--card-border);
    color: var(--feature-icon);
    font-size: 16px;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 360px;
}

.btn-welcome-access {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    text-align: left;
    position: relative;
    font-family: inherit;
}

.btn-welcome-access::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.6);
    transition: box-shadow 0.4s ease;
    pointer-events: none;
}

.btn-welcome-access:hover,
.btn-welcome-access:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(0, 123, 255, 0.5);
    background: linear-gradient(135deg, #0088ff, #0066cc);
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
}

.btn-welcome-access:hover::after {
    box-shadow: 0 0 0 6px rgba(0, 212, 255, 0.15);
}

.btn-access-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    font-size: 26px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-access-text {
    flex: 1;
    padding: 0 20px 0 24px;
    font-size: 16.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-access-arrow {
    padding-right: 26px;
    font-size: 14px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.btn-welcome-access:hover .btn-access-arrow {
    transform: translateX(4px);
}

.welcome-footer {
    padding: 18px 8%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    border-top: 1px solid var(--card-border);
    background: var(--franja-bg);
    backdrop-filter: blur(10px);
}

.welcome-copy {
    font-size: 13px;
    color: var(--label-color);
}

.welcome-support {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 13.5px;
    color: var(--label-color);
    text-align: right;
}

.welcome-support strong {
    color: var(--text-color);
    font-weight: 600;
    font-size: 14.5px;
}

.welcome-support i {
    margin-right: 4px;
    color: var(--feature-icon);
}

/* ---------- Inicio de sesión ---------- */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
}

.login-form {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 48px 35px 36px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
    animation: floatIn 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
    position: relative;
}

.login-form:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.btn-back-welcome {
    position: absolute;
    top: 18px;
    left: 18px;
    background: transparent;
    border: none;
    color: var(--label-color);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.btn-back-welcome:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #00d4ff;
}

body.light .btn-back-welcome:hover {
    color: #007bff;
}

.logo {
    max-height: 100px;
    width: auto;
    display: block;
    margin: 0 auto 15px;
    filter: drop-shadow(0 0 8px rgba(0, 123, 255, 0.3));
    transition: filter 0.3s ease;
}

.logo:hover {
    filter: drop-shadow(0 0 12px rgba(0, 123, 255, 0.5));
}

.login-form h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #00d4ff, #007bff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

body.light .login-form h1 {
    background: linear-gradient(135deg, #0056b3, #007bff, #00a3ff);
    -webkit-background-clip: text;
    background-clip: text;
}

.login-form h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #007bff, #00d4ff, transparent);
    border-radius: 3px;
}

.login-subtitle {
    margin: 18px 0 26px;
    font-size: 13.5px;
    color: var(--label-color);
}

.input-group {
    margin-bottom: 24px;
    text-align: left;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--label-color);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 16px;
    color: var(--text-color);
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #007bff;
    box-shadow: var(--input-focus-effect);
}

.input-group input::placeholder {
    color: rgba(130, 160, 195, 0.75);
    font-size: 13px;
}

.input-group:focus-within label {
    color: #00d4ff;
}

body.light .input-group:focus-within label {
    color: #007bff;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--label-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus {
    color: #00d4ff;
    outline: none;
}

body.light .toggle-password:hover,
body.light .toggle-password:focus {
    color: #007bff;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.login-register {
    font-size: 14px;
    margin-top: 25px;
    color: var(--label-color);
}

.login-register a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.login-register a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--link-color), #007bff);
    transition: width 0.3s ease;
}

.login-register a:hover {
    color: var(--link-hover);
}

.login-register a:hover::after {
    width: 100%;
}

/* Enlace de registro en la pantalla de bienvenida, debajo de "Acceso a estudiantes" */
.welcome-register {
    margin-top: -4px;
    text-align: center;
    font-size: 14.5px;
    color: var(--text-color);
}

/* Sin subtítulo: separación entre el título del login y el formulario */
.login-form h1 + form {
    margin-top: 30px;
}

/* ---------- Mensajes (js/demo-login.js) ---------- */
.modal-alert {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 16px;
    animation: fadeInBackdrop 0.3s ease;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--modal-bg);
    backdrop-filter: blur(12px);
    padding: 35px;
    border-radius: 32px;
    width: 380px;
    max-width: 100%;
    text-align: center;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

body.light .modal-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

@keyframes modalPop {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h3 {
    font-size: 26px;
    margin-bottom: 15px;
    font-weight: 700;
}

.modal-content.success {
    border-top: 3px solid #22c55e;
}

.modal-content.success h3 {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-content.error {
    border-top: 3px solid #ef4444;
}

.modal-content.error h3 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-content p {
    color: var(--modal-text);
    margin: 20px 0;
    font-size: 15px;
    line-height: 1.5;
}

.modal-content button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 40px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .welcome-main {
        flex-direction: column;
        padding: 40px 5%;
        gap: 40px;
    }

    .welcome-content {
        max-width: 100%;
    }

    .welcome-title {
        font-size: 36px;
    }

    .welcome-logo {
        width: 104px;
    }

    .welcome-actions {
        width: 100%;
        max-width: 520px;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .welcome-header {
        padding: 14px 5%;
        padding-right: 72px;
    }

    .institution {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 10.5px;
    }

    .welcome-main {
        padding: 30px 16px;
    }

    .welcome-brand {
        gap: 14px;
    }

    .welcome-logo {
        width: 72px;
    }

    .welcome-title {
        font-size: 26px;
    }

    .welcome-description {
        font-size: 13.5px;
        text-align: left;
    }

    .welcome-features li {
        font-size: 13.5px;
    }

    .btn-access-icon {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    .btn-access-text {
        font-size: 15px;
        padding: 0 12px 0 16px;
    }

    .btn-access-arrow {
        padding-right: 18px;
    }

    .welcome-footer {
        padding: 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .welcome-support {
        align-items: center;
        text-align: center;
    }

    .container {
        padding: 15px;
    }

    .login-form {
        padding: 48px 22px 28px;
    }

    .login-form h1 {
        font-size: 20px;
    }

    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .theme-toggle i {
        font-size: 17px;
    }
}
