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

body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1f5c 0%, #0d47a1 40%, #1976d2 70%, #29b6f6 100%);
    overflow-x: hidden;
    position: relative;
}

/* Grid overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Floating spheres */
.sphere {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.55), rgba(100,180,255,0.3) 50%, rgba(30,100,200,0.15));
    box-shadow: inset -4px -4px 20px rgba(0,0,0,0.15), 0 8px 32px rgba(0,80,180,0.3);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}
.sphere-1 { width: 180px; height: 180px; top: -40px; right: 60px; animation-delay: 0s; }
.sphere-2 { width: 100px; height: 100px; top: 80px; right: 20px; animation-delay: 1.5s; }
.sphere-3 { width: 60px;  height: 60px;  top: 160px; right: 200px; animation-delay: 3s; }
.sphere-4 { width: 80px;  height: 80px;  bottom: 60px; right: 40px; animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-18px); }
}

.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 16px;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.2);
}

/* Card header */
.login-card-header {
    background: #ffffff;
    padding: 36px 36px 28px;
    text-align: center;
    border-bottom: 1px solid #e8edf5;
}

.logo-wrap img {
    height: 72px;
    object-fit: contain;
}

.brand-tagline {
    margin-top: 10px;
    font-size: 10px;
    letter-spacing: 3px;
    color: #546e7a;
    text-transform: uppercase;
    font-weight: 600;
}

.gold-bar {
    width: 40px;
    height: 3px;
    background: #f5a623;
    border-radius: 2px;
    margin: 10px auto 0;
}

/* Card body */
.login-card-body {
    padding: 36px 36px 28px;
}

.signin-title {
    font-size: 22px;
    font-weight: 800;
    color: #0a2472;
    margin-bottom: 6px;
}

.signin-sub {
    font-size: 13px;
    color: #78909c;
    margin-bottom: 24px;
}

.ozone-alert {
    background: #fff3f3;
    border-left: 4px solid #e53935;
    color: #c62828;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form fields */
.field-group {
    margin-bottom: 18px;
}

.field-label {
    font-size: 12px;
    font-weight: 700;
    color: #455a64;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.field-input-wrap {
    display: flex;
    border: 2px solid #e0e7ef;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.field-input-wrap:focus-within {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

.field-icon {
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f0fe;
    color: #1565c0;
    font-size: 15px;
    flex-shrink: 0;
}

.field-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #1a237e;
    background: transparent;
}

.field-input-wrap input::placeholder { color: #b0bec5; }

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    font-size: 13px;
    color: #546e7a;
}

.remember-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #1565c0;
    cursor: pointer;
}

/* Login button */
.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #f5a623 0%, #f9a825 100%);
    color: #0a2472;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(245,166,35,0.4);
}

.btn-login:hover {
    background: linear-gradient(135deg, #ffb300 0%, #ffc107 100%);
    box-shadow: 0 6px 20px rgba(245,166,35,0.5);
    transform: translateY(-1px);
}

.btn-login:active { transform: translateY(0); }

/* Card footer */
.login-card-footer {
    background: #f5f8ff;
    border-top: 1px solid #e8edf5;
    padding: 14px 36px;
    text-align: center;
    font-size: 11px;
    color: #90a4ae;
    letter-spacing: 0.5px;
}

/* PWA install button */
#installBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 18px;
    background: #f5a623;
    border: none;
    color: #0a2472;
    border-radius: 10px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
}

@media (max-width: 480px) {
    body { align-items: flex-start; }
    .login-wrapper     { padding: 8px 12px 16px; }
    .login-card-header { padding: 16px 20px 16px; }
    .login-card-body   { padding: 20px 20px 16px; }
    .login-card-footer { padding: 10px 20px; }
    .sphere-1 { width: 120px; height: 120px; }
}

/* ── Entrance animations ───────────────────────────────────────── */

.login-wrapper {
    animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(56px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.logo-wrap img {
    animation: logoBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}
@keyframes logoBounce {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

.brand-tagline { animation: fadeSlideUp 0.4s ease 0.55s both; }
.signin-title  { animation: fadeSlideUp 0.4s ease 0.55s both; }
.signin-sub    { animation: fadeSlideUp 0.4s ease 0.65s both; }

.gold-bar { animation: expandBar 0.5s ease 0.65s both; }
@keyframes expandBar {
    from { opacity: 0; width: 0; }
    to   { opacity: 1; width: 40px; }
}

.field-group:first-of-type { animation: fadeSlideUp 0.4s ease 0.72s both; }
.field-group:last-of-type  { animation: fadeSlideUp 0.4s ease 0.82s both; }
.remember-row              { animation: fadeSlideUp 0.4s ease 0.92s both; }
.btn-login                 { animation: fadeSlideUp 0.4s ease 1.02s both; }
.login-card-footer         { animation: fadeIn      0.4s ease 1.12s both; }

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Sphere transition for JS parallax ────────────────────────── */
.sphere { transition: transform 0.1s ease-out; }

/* ── Button ripple ─────────────────────────────────────────────── */
.btn-login { position: relative; overflow: hidden; }

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleAnim 0.55s linear;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}
