/* ═══════════════════════════════════════════════════════════
   UNIVGA Login Page — Crystal Tech Animated Background
   Navy Blue + Gold · Professional · Immersive
   ═══════════════════════════════════════════════════════════ */

/* Reset for login wrapper */
.univga-login-page,
.univga-login-page * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── FULL PAGE WRAPPER ─────────────────────────────────── */
.univga-login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a2e;
}

/* ─── ANIMATED CRYSTAL BACKGROUND ────────────────────────── */
.univga-login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Gradient base */
.univga-login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, #1a1a5e 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, #2a2978 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, #0d0d3a 0%, transparent 60%),
                linear-gradient(135deg, #0a0a2e 0%, #151550 50%, #0a0a2e 100%);
}

/* Crystal shapes */
.crystal {
    position: absolute;
    border: 1px solid rgba(212, 168, 83, 0.15);
    background: linear-gradient(135deg, rgba(51, 50, 121, 0.3), rgba(212, 168, 83, 0.05));
    backdrop-filter: blur(2px);
    animation: crystalFloat 20s ease-in-out infinite;
}

.crystal-1 {
    width: 200px; height: 200px;
    top: 10%; left: 5%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation-delay: 0s;
    animation-duration: 25s;
}
.crystal-2 {
    width: 150px; height: 150px;
    top: 60%; right: 8%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: -5s;
    animation-duration: 22s;
    border-color: rgba(212, 168, 83, 0.12);
}
.crystal-3 {
    width: 120px; height: 120px;
    bottom: 15%; left: 15%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    animation-delay: -10s;
    animation-duration: 28s;
}
.crystal-4 {
    width: 180px; height: 180px;
    top: 5%; right: 20%;
    clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
    animation-delay: -3s;
    animation-duration: 30s;
    border-color: rgba(74, 73, 160, 0.2);
}
.crystal-5 {
    width: 100px; height: 100px;
    bottom: 30%; right: 30%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation-delay: -8s;
    animation-duration: 20s;
}
.crystal-6 {
    width: 160px; height: 160px;
    top: 40%; left: 30%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: -12s;
    animation-duration: 26s;
    border-color: rgba(212, 168, 83, 0.1);
}

@keyframes crystalFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    25% { transform: translateY(-30px) rotate(5deg); opacity: 0.8; }
    50% { transform: translateY(-15px) rotate(-3deg); opacity: 0.5; }
    75% { transform: translateY(-40px) rotate(7deg); opacity: 0.7; }
}

/* Floating light particles */
.particle {
    position: absolute;
    width: 4px; height: 4px;
    background: rgba(212, 168, 83, 0.6);
    border-radius: 50%;
    animation: particleRise linear infinite;
    box-shadow: 0 0 6px rgba(212, 168, 83, 0.4);
}
.particle:nth-child(8)  { left: 10%; animation-duration: 12s; animation-delay: 0s; width: 3px; height: 3px; }
.particle:nth-child(9)  { left: 25%; animation-duration: 15s; animation-delay: -2s; width: 5px; height: 5px; }
.particle:nth-child(10) { left: 40%; animation-duration: 11s; animation-delay: -5s; }
.particle:nth-child(11) { left: 55%; animation-duration: 14s; animation-delay: -3s; width: 3px; height: 3px; }
.particle:nth-child(12) { left: 70%; animation-duration: 13s; animation-delay: -7s; width: 5px; height: 5px; }
.particle:nth-child(13) { left: 85%; animation-duration: 16s; animation-delay: -1s; }
.particle:nth-child(14) { left: 50%; animation-duration: 10s; animation-delay: -9s; width: 3px; height: 3px; }
.particle:nth-child(15) { left: 15%; animation-duration: 18s; animation-delay: -4s; }

@keyframes particleRise {
    0% { bottom: -10px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.6; }
    100% { bottom: 110vh; opacity: 0; }
}

/* Grid lines overlay */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(51, 50, 121, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 50, 121, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* Glowing orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbDrift 15s ease-in-out infinite;
}
.glow-orb-1 {
    width: 400px; height: 400px;
    top: -100px; left: -100px;
    background: rgba(51, 50, 121, 0.4);
    animation-duration: 18s;
}
.glow-orb-2 {
    width: 300px; height: 300px;
    bottom: -50px; right: -50px;
    background: rgba(212, 168, 83, 0.15);
    animation-delay: -5s;
    animation-duration: 20s;
}
.glow-orb-3 {
    width: 250px; height: 250px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(74, 73, 160, 0.2);
    animation-delay: -10s;
    animation-duration: 22s;
}

@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ─── LOGIN CONTAINER ────────────────────────────────────── */
.univga-login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 520px;
    padding: 20px;
}

/* Glass card */
.univga-login-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── LOGO / HEADER ──────────────────────────────────────── */
.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #333279, #4a49a0);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(51, 50, 121, 0.4);
    position: relative;
    overflow: hidden;
}
.login-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(212, 168, 83, 0.3));
    border-radius: inherit;
}
.login-logo i {
    font-size: 1.8em;
    color: #d4a853;
    position: relative;
    z-index: 1;
}
.login-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.login-header h1 {
    font-size: 1.6em;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}
.login-header p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.92em;
    line-height: 1.5;
}

/* ─── FORM ───────────────────────────────────────────────── */
.univga-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field {
    position: relative;
}

.form-field label {
    display: block;
    font-size: 0.82em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-wrap > i {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: #d4a853;
    font-size: 1.1em;
    transition: color 0.2s;
}

.input-wrap input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95em;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
    min-width: 0;
}

.input-wrap input[type="password"],
.input-wrap input.has-toggle {
    padding-right: 46px;
}

.input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-wrap input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(212, 168, 83, 0.5);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

.input-wrap:focus-within > i {
    color: #e8c878;
}

/* Toggle password */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #6b8aff;
    cursor: pointer;
    font-size: 0.95em;
    padding: 4px;
    z-index: 1;
    transition: color 0.2s;
}
.toggle-password:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Remember / forgot row */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -4px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d4a853;
    cursor: pointer;
}
.remember-me span {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

.forgot-link {
    font-size: 0.85em;
    color: #d4a853;
    text-decoration: none;
    transition: color 0.2s;
}
.forgot-link:hover {
    color: #e8c878;
    text-decoration: underline;
}

/* Submit button */
.login-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #333279, #4a49a0);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}
.login-submit-btn:hover::before {
    opacity: 1;
}
.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(51, 50, 121, 0.5);
}
.login-submit-btn:active {
    transform: translateY(0);
}

/* Loading state */
.login-submit-btn.is-loading {
    pointer-events: none;
    opacity: 0.8;
}
.login-submit-btn .btn-text { position: relative; z-index: 1; }
.login-submit-btn .btn-spinner {
    display: none;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.login-submit-btn.is-loading .btn-text { display: none; }
.login-submit-btn.is-loading .btn-spinner { display: block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error message */
.login-error {
    display: none;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fca5a5;
    font-size: 0.88em;
    line-height: 1.5;
    animation: shakeIn 0.4s ease;
}
.login-error.visible {
    display: flex;
    align-items: center;
    gap: 10px;
}
.login-error i {
    font-size: 1.1em;
    color: #ef4444;
    flex-shrink: 0;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ─── FOOTER LINKS ───────────────────────────────────────── */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.login-footer p {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.88em;
}
.login-footer a {
    color: #d4a853;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.login-footer a:hover {
    color: #e8c878;
    text-decoration: underline;
}

/* ─── BOTTOM BRAND ───────────────────────────────────────── */
.login-brand {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.78em;
    letter-spacing: 1px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .univga-login-container {
        padding: 16px;
    }
    .univga-login-card {
        padding: 36px 24px;
        border-radius: 16px;
    }
    .login-logo {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }
    .login-logo i {
        font-size: 1.5em;
    }
    .login-header h1 {
        font-size: 1.35em;
    }
    .crystal { display: none; }
    .login-brand { bottom: 12px; }
}

@media (max-height: 700px) {
    .univga-login-card {
        padding: 32px 36px;
    }
    .login-header {
        margin-bottom: 24px;
    }
    .login-footer {
        margin-top: 20px;
        padding-top: 16px;
    }
}
