*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #0d1f3c;
    --navy-mid:   #132847;
    --navy-light: #1e3a5f;
    --blue:       #1a5cb8;
    --blue-hover: #1649a0;
    --green:      #2ec99e;
    --green-soft: #d4f5ec;
    --white:      #ffffff;
    --grey-1:     #f0f4f9;
    --grey-2:     #c8d5e8;
    --grey-3:     #8099b8;
    --text-dark:  #0d1f3c;
    --text-mid:   #3d5478;
    --text-light: #7a93b5;
    --shadow:     0 24px 64px rgba(13,31,60,0.18), 0 4px 16px rgba(13,31,60,0.10);
}

html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: var(--navy);
    overflow: hidden;
}

/* ── ANIMATED BACKGROUND ── */
.bg {
    position: fixed; inset: 0;
    background:
            radial-gradient(ellipse 80% 60% at 20% 10%, rgba(30,58,95,0.9) 0%, transparent 60%),
            radial-gradient(ellipse 60% 80% at 80% 90%, rgba(46,201,158,0.08) 0%, transparent 55%),
            radial-gradient(ellipse 70% 50% at 60% 20%, rgba(26,92,184,0.15) 0%, transparent 50%),
            linear-gradient(145deg, #091629 0%, #0d1f3c 40%, #112544 70%, #0a1c36 100%);
    z-index: 0;
}

.bg-grid {
    position: fixed; inset: 0; z-index: 1;
    background-image:
            linear-gradient(rgba(46,201,158,0.04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(46,201,158,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 75%);
}

/* floating orbs */
.orb {
    position: fixed; border-radius: 50%; filter: blur(80px);
    z-index: 1; pointer-events: none; animation: drift 18s ease-in-out infinite;
}
.orb-1 { width: 420px; height: 420px; background: rgba(26,92,184,0.14); top: -120px; left: -80px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: rgba(46,201,158,0.08); bottom: -60px; right: -40px; animation-delay: -7s; }
.orb-3 { width: 200px; height: 200px; background: rgba(26,92,184,0.10); top: 40%; left: 70%; animation-delay: -12s; }

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(20px, -30px) scale(1.05); }
    66%       { transform: translate(-15px, 20px) scale(0.97); }
}

/* ── LAYOUT ── */
.page {
    position: relative; z-index: 2;
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px;
}

/* ── CARD ── */
.card {
    width: 100%; max-width: 440px;
    background: rgba(255,255,255,0.97);
    border-radius: 20px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.06);
    overflow: hidden;
    animation: cardIn 0.7s cubic-bezier(0.22,1,0.36,1) both;
}

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

/* ── CARD HEADER ── */
.card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    padding: 36px 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: headerIn 0.7s 0.1s cubic-bezier(0.22,1,0.36,1) both;
}

.card-header::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 120% 100% at 50% 120%, rgba(46,201,158,0.12) 0%, transparent 65%);
}

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

.logo-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--green) 0%, #1bb88a 100%);
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(46,201,158,0.35);
    position: relative; z-index: 1;
    animation: logoIn 0.6s 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes logoIn {
    from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.logo-icon {
    width: 32px; height: 32px; fill: var(--white);
}

.sys-name {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 2.5px;
    color: var(--white);
    text-transform: uppercase;
    position: relative; z-index: 1;
    animation: fadeUp 0.6s 0.35s both;
}

.sys-name span { color: var(--green); }

.sys-subtitle {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--grey-2);
    letter-spacing: 0.6px;
    margin-top: 6px;
    position: relative; z-index: 1;
    animation: fadeUp 0.6s 0.45s both;
}

.divider-line {
    width: 48px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
    margin: 14px auto 0;
    position: relative; z-index: 1;
    animation: fadeUp 0.6s 0.5s both;
}

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

/* ── CARD BODY ── */
.card-body {
    padding: 36px 40px 28px;
}

.welcome-text {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 26px;
    letter-spacing: 0.2px;
    animation: fadeUp 0.6s 0.55s both;
}

.welcome-text strong {
    display: block;
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

/* ── FORM FIELDS ── */
.field {
    margin-bottom: 18px;
    animation: fadeUp 0.6s both;
}
.field:nth-child(2) { animation-delay: 0.6s; }
.field:nth-child(3) { animation-delay: 0.68s; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 8px;
}

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

.input-icon {
    position: absolute; left: 14px;
    width: 18px; height: 18px;
    color: var(--grey-3);
    transition: color 0.2s;
    pointer-events: none;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 44px;
    border: 1.5px solid var(--grey-2);
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    color: var(--text-dark);
    background: var(--grey-1);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

input::placeholder { color: var(--text-light); font-size: 14px; }

input:focus {
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26,92,184,0.10);
}

input:focus + .input-icon,
.input-wrap:focus-within .input-icon { color: var(--blue); }

.toggle-pass {
    position: absolute; right: 14px;
    background: none; border: none; cursor: pointer;
    color: var(--grey-3); padding: 0;
    display: flex; align-items: center;
    transition: color 0.2s;
}
.toggle-pass:hover { color: var(--blue); }
.toggle-pass svg { width: 18px; height: 18px; }

/* ── CHECKBOX ROW ── */
.row-options {
    display: flex; align-items: center; justify-content: space-between;
    margin: 6px 0 24px;
    animation: fadeUp 0.6s 0.74s both;
}

.checkbox-label {
    display: flex; align-items: center; gap: 9px;
    cursor: pointer;
    font-size: 13px; color: var(--text-mid);
    user-select: none;
}

.checkbox-label input[type="checkbox"] { display: none; }

.custom-check {
    width: 18px; height: 18px; border-radius: 5px;
    border: 1.5px solid var(--grey-2);
    background: var(--grey-1);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-label input:checked ~ .custom-check {
    background: var(--blue);
    border-color: var(--blue);
}

.custom-check svg { width: 11px; height: 11px; stroke: white; opacity: 0; transition: opacity 0.15s; }
.checkbox-label input:checked ~ .custom-check svg { opacity: 1; }

.forgot-link {
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}
.forgot-link:hover { color: var(--blue-hover); text-decoration: underline; }

/* ── BUTTON ── */
.btn-enter {
    width: 100%; height: 50px;
    background: linear-gradient(135deg, var(--blue) 0%, #1248a8 100%);
    color: var(--white);
    border: none; border-radius: 10px;
    font-family: 'Sora', sans-serif;
    font-size: 15px; font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative; overflow: hidden;
    transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 6px 20px rgba(26,92,184,0.35);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    animation: fadeUp 0.6s 0.8s both;
}

.btn-enter::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    transition: opacity 0.2s;
}

.btn-enter:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26,92,184,0.45);
}

.btn-enter:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(26,92,184,0.3); }

.btn-enter .btn-arrow {
    width: 18px; height: 18px;
    transition: transform 0.2s;
}
.btn-enter:hover .btn-arrow { transform: translateX(3px); }

/* ripple */
.btn-enter .ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transform: scale(0);
    animation: ripple 0.5s linear;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ── BADGE ── */
.security-badge {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    margin-top: 18px;
    font-size: 11.5px; color: var(--text-light); letter-spacing: 0.3px;
    animation: fadeUp 0.6s 0.88s both;
}
.security-badge svg { width: 13px; height: 13px; color: var(--green); }

/* ── FOOTER ── */
.card-footer {
    background: var(--grey-1);
    border-top: 1px solid #e5ecf5;
    padding: 14px 40px;
    display: flex; align-items: center; justify-content: space-between;
    animation: fadeUp 0.6s 0.95s both;
}

.footer-brand {
    font-size: 11px; color: var(--text-light); letter-spacing: 0.3px;
}
.footer-brand strong { color: var(--text-mid); font-weight: 600; }

.version-tag {
    font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--blue);
    background: rgba(26,92,184,0.08);
    padding: 3px 8px; border-radius: 20px;
}

/* ── BOTTOM TEXT ── */
.bottom-text {
    margin-top: 20px;
    font-size: 11px; color: rgba(255,255,255,0.3);
    letter-spacing: 0.3px;
    text-align: center;
    animation: fadeUp 0.6s 1s both;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .card-header { padding: 28px 24px 24px; }
    .card-body   { padding: 28px 24px 20px; }
    .card-footer { padding: 12px 24px; flex-direction: column; gap: 6px; text-align: center; }
    .sys-name    { font-size: 18px; }
}

.error-message {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}