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

body {
    font-family: 'Courier New', Courier, monospace;
    min-height: 100vh;
    background-image: url('../static/Resources/Login_Page_Loop.gif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 6vw;
    position: relative;
}

/* Dark overlay on the background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 16, 0.55);
    z-index: 0;
}

/* ── FORM CARD ─────────────────────────────────────────────────────── */
.form-card {
    position: relative;
    z-index: 1;
    background: rgba(10, 22, 20, 0.92);
    border: 1px solid rgba(0, 229, 194, 0.4);
    border-radius: 4px;
    padding: 36px 32px;
    width: 440px;
    box-shadow:
        0 0 0 1px rgba(0, 229, 194, 0.15),
        0 0 24px rgba(0, 229, 194, 0.15),
        0 0 60px rgba(0, 229, 194, 0.08),
        inset 0 0 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
}

/* Neon corner accents */
.form-card::before,
.form-card::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: #00e5c2;
    border-style: solid;
}
.form-card::before {
    top: -1px;
    right: -1px;
    border-width: 2px 2px 0 0;
}
.form-card::after {
    bottom: -1px;
    left: -1px;
    border-width: 0 0 2px 2px;
}

/* ── HEADER ────────────────────────────────────────────────────────── */
.form-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-header-title {
    font-size: 1.05rem;
    letter-spacing: 0.3em;
    color: #00e5c2;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 229, 194, 0.6);
    margin-bottom: 4px;
}

.form-header-sub {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(0, 229, 194, 0.4);
    text-transform: uppercase;
}

/* ── TABS ──────────────────────────────────────────────────────────── */
.tab-input { display: none; }

.tab-buttons {
    display: flex;
    margin-bottom: 28px;
    border: 1px solid rgba(0, 229, 194, 0.25);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.tab-button {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: rgba(0, 229, 194, 0.45);
    text-transform: uppercase;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
    user-select: none;
}

/* Active tab sliding indicator */
.tab-buttons::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(0, 229, 194, 0.1);
    border-right: 1px solid rgba(0, 229, 194, 0.3);
    transition: transform 0.25s ease;
    z-index: 1;
}
#signup-tab:checked ~ .tab-buttons::before {
    transform: translateX(100%);
    border-right: none;
    border-left: 1px solid rgba(0, 229, 194, 0.3);
}

#login-tab:checked  ~ .tab-buttons .login-label  { color: #00e5c2; text-shadow: 0 0 8px rgba(0,229,194,0.5); }
#signup-tab:checked ~ .tab-buttons .signup-label { color: #00e5c2; text-shadow: 0 0 8px rgba(0,229,194,0.5); }

/* ── FORM VISIBILITY ───────────────────────────────────────────────── */
#login-form  { display: block; }
#signup-form { display: none;  }
#signup-tab:checked ~ #login-form  { display: none;  }
#signup-tab:checked ~ #signup-form { display: block; }

/* ── FORM GROUPS ───────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: rgba(0, 229, 194, 0.6);
    text-transform: uppercase;
    margin-bottom: 7px;
    text-align: right;
}

.form-group input,
.form-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(0, 20, 18, 0.7);
    border: 1px solid rgba(0, 229, 194, 0.2);
    border-radius: 3px;
    color: #c8f5ef;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    text-align: right;
    direction: rtl;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus,
.form-input:focus {
    border-color: rgba(0, 229, 194, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 229, 194, 0.08), 0 0 12px rgba(0, 229, 194, 0.12);
    background: rgba(0, 30, 26, 0.8);
}

.form-group input::placeholder,
.form-input::placeholder {
    color: rgba(0, 229, 194, 0.2);
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px rgba(0, 20, 18, 0.9) inset;
    -webkit-text-fill-color: #c8f5ef;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── SUBMIT BUTTON ─────────────────────────────────────────────────── */
.submit-btn {
    width: 100%;
    padding: 13px;
    margin-top: 6px;
    background: transparent;
    border: 1px solid rgba(0, 229, 194, 0.5);
    border-radius: 3px;
    color: #00e5c2;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 229, 194, 0.07);
    opacity: 0;
    transition: opacity 0.2s;
}

.submit-btn:hover {
    border-color: #00e5c2;
    box-shadow: 0 0 16px rgba(0, 229, 194, 0.25), inset 0 0 16px rgba(0, 229, 194, 0.05);
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 229, 194, 0.8);
}
.submit-btn:hover::before { opacity: 1; }

/* ── REMEMBER ME ───────────────────────────────────────────────────── */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    direction: rtl;
}

.remember-me input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #00e5c2;
    cursor: pointer;
    flex-shrink: 0;
}

.remember-me label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(0, 229, 194, 0.5);
    cursor: pointer;
    user-select: none;
}

.remember-me label:hover {
    color: #00e5c2;
}

/* ── FORGOT PASSWORD ───────────────────────────────────────────────── */
.forgot-password {
    text-align: center;
    margin-top: 16px;
}

.forgot-password a {
    color: rgba(0, 229, 194, 0.4);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}
.forgot-password a:hover {
    color: #00e5c2;
    text-shadow: 0 0 8px rgba(0, 229, 194, 0.4);
}

/* ── SCANLINE EFFECT (subtle) ──────────────────────────────────────── */
.form-card .scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 4px
    );
    pointer-events: none;
    border-radius: 4px;
    z-index: 0;
}

/* All content above scanlines */
.tab-input,
.tab-buttons,
.form-content {
    position: relative;
    z-index: 1;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────── */

/* Tablet: 481px – 900px */
@media (max-width: 900px) {
    body {
        justify-content: center;
        padding: 24px 20px;
        /* Shift background focus to the desk/center of the image */
        background-position: 40% center;
        align-items: center;
    }

    body::before {
        /* Slightly darker overlay on smaller screens for readability */
        background: rgba(8, 18, 16, 0.68);
    }

    .form-card {
        width: 100%;
        max-width: 420px;
    }
}

/* Mobile: ≤ 480px */
@media (max-width: 480px) {
    body {
        /* Focus on the neon sign area which looks good on portrait */
        background-position: 35% top;
        padding: 16px;
        align-items: flex-end;
        padding-bottom: 24px;
    }

    body::before {
        background: rgba(8, 18, 16, 0.75);
    }

    .form-card {
        width: 100%;
        max-width: 100%;
        padding: 28px 20px;
        /* Remove border-radius on sides so it feels like a bottom sheet */
        border-radius: 8px 8px 4px 4px;
    }

    .form-header-title {
        font-size: 1rem;
    }

    .form-header {
        margin-bottom: 20px;
    }

    .tab-buttons {
        margin-bottom: 20px;
    }

    .tab-button {
        padding: 12px 10px;    /* Bigger tap target */
        font-size: 0.78rem;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group input,
    .form-input {
        padding: 13px 14px;    /* Taller inputs = easier to tap */
        font-size: 1rem;       /* Prevents iOS auto-zoom on focus (needs ≥16px or close) */
    }

    .form-label {
        font-size: 0.68rem;
    }

    .submit-btn {
        padding: 15px;         /* Bigger tap target */
        font-size: 0.85rem;
    }

    .forgot-password {
        margin-top: 14px;
    }

    .forgot-password a {
        font-size: 0.8rem;     /* Slightly bigger for touch */
    }
}