:root {
    --aqua: #00CFC8;
    --deep: #008F95;
    --light: #E6FAF9;
    --bg: #F5FAFA;
    --text: #172B35;
    --muted: #71838B;
    --border: #DCEBEC;
    --bad: #C0392B;

    /* New variables for theming */
    --card-bg: #ffffff;
    --input-bg: #ffffff;
}

[data-theme="dark"] {
    --aqua: #00E5DE;
    --deep: #00A8AF;
    --light: #1a2f33;
    --bg: #0f171a;
    --text: #e0e6e8;
    --muted: #8b9ca3;
    --border: #2a3b40;
    --bad: #ff6b6b;

    --card-bg: #1c262b;
    --input-bg: #121c1f;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--deep)
}

button,
input,
select,
textarea {
    font: inherit;
    color: var(--text);
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: .75rem 1.2rem;
    background: var(--deep);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s
}

.btn:hover {
    background: #007278
}

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

.btn.ghost {
    background: var(--light);
    color: var(--deep)
}

.btn.ghost:hover {
    background: var(--border)
}

:focus-visible {
    outline: 3px solid var(--aqua);
    outline-offset: 2px
}

.field {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: .9rem
}

.field input,
.field select,
.field textarea {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .7rem .85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
    transition: background 0.3s, border-color 0.3s;
}

.pw {
    position: relative;
    display: block
}

.pw button {
    position: absolute;
    right: .6rem;
    bottom: .55rem;
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer
}

.msg {
    min-height: 1.4em;
    font-size: .9rem;
    margin: .5rem 0
}

.msg.err {
    color: var(--bad)
}

.msg.ok {
    color: var(--deep)
}

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr
}

.auth aside {
    background: linear-gradient(to top, rgba(0, 71, 75, .88) 0%, rgba(0, 71, 75, .45) 28%, transparent 55%), url(../assets/images/auth-hero.svg) center/cover no-repeat, var(--deep);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end
}

.auth aside h1 {
    font-size: 2.6rem;
    margin: 0 0 .5rem
}

.auth aside p {
    max-width: 28ch;
    margin: 0;
    opacity: .9
}

.auth main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--card-bg);
    transition: background 0.3s;
}

.auth form {
    width: 100%;
    max-width: 380px
}

.auth h2 {
    margin-top: 0
}

.sim {
    font-size: .8rem;
    color: var(--muted)
}

@media(max-width:800px) {
    .auth {
        grid-template-columns: 1fr
    }

    .auth aside {
        padding: 2rem;
        min-height: 30vh
    }
}

/* --- RESPONSIVE FIXES FOR IPHONE 6 & 4K --- */

/* 1. Small Phones (iPhone 6, SE, etc. - max-width: 400px) */
@media (max-width: 400px) {
    body {
        font-size: 14px;
    }

    .wrap {
        padding: 0.8rem;
    }

    .net {
        padding: 1.2rem;
    }

    .net .total {
        font-size: 2rem;
        /* Smaller balance text */
    }

    .card {
        padding: 1rem;
    }

    .field input,
    .field select,
    .field textarea {
        padding: 0.6rem;
        font-size: 14px;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 14px;
    }

    h1 {
        font-size: 1.3rem !important;
    }

    h2 {
        font-size: 1.1rem !important;
    }

    h3 {
        font-size: 1rem !important;
    }
}

/* 2. Ultra-Wide & 4K Screens (min-width: 1600px) */
@media (min-width: 1600px) {
    .wrap {
        max-width: 1400px;
        /* Don't let it stretch infinitely */
        padding: 3rem;
    }

    body {
        font-size: 18px;
    }

    .card {
        padding: 2rem;
    }

    .net {
        padding: 3rem;
    }

    .net .total {
        font-size: 4rem;
    }
}