/* Login page styles (migrated from login.php inline style) */
:root {
    --bg: #f3f0e9;
    --card: #fffdf8;
    --ink: #1c2933;
    --muted: #5d6875;
    --accent: #cd7a25;
    --accent-2: #0f7f95;
    --line: #d4d9cd;
    --soft: #edf1e8;
    --font-size-caption: 12px;
    --font-size-body-sm: 13px;
    --font-size-body: 14px;
    --font-size-body-lg: 16px;
    --font-size-h1: clamp(24px, 3.6vw, 28px);
    --font-size-h2: clamp(20px, 3vw, 24px);
    --line-height-body: 1.45;
    --line-height-heading: 1.2;
}
body {
    margin: 0;
    font-family: "Avenir Next", "Futura", "Trebuchet MS", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
.topbar {
    background: #2f2f2f;
    color: #fefbf5;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    display: grid;
    place-items: center;
    letter-spacing: 0.5px;
}
.brand-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.brand-title span:first-child {
    font-size: 16px;
    font-weight: 700;
}
.brand-title span:last-child {
    font-size: 12px;
    color: #b9c0c8;
}
.wrap {
    max-width: 440px;
    margin: 30px auto 60px;
    padding: 24px 20px;
}
.tabs {
    display: flex;
    gap: 0;
    background: #ffffff;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
    margin-bottom: 16px;
    box-shadow: 0 10px 20px rgba(31, 45, 61, 0.08);
}
.tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    margin-top: 0;
    width: auto;
    border-radius: 999px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.tab.is-active {
    background: #2f2f2f;
    color: #ffffff;
    transform: translateY(-1px);
}
.tab:not(.is-active):hover {
    color: var(--ink);
}
.tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 142, 173, 0.35);
}
.tab-panels {
    display: block;
}
.tabs-help {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
}
.tab-panel {
    display: none;
}
.tab-panel.is-active {
    display: block;
}
.card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(31, 45, 61, 0.08);
    padding: 24px;
    border: 1px solid var(--line);
}
.card + .card {
    margin-top: 16px;
}
h1 {
    margin: 0 0 12px;
    font-size: 26px;
}
h2 {
    margin: 0 0 12px;
    font-size: 20px;
}
.subtext {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
}
.subtext-tight {
    margin: 4px 0 8px;
    font-size: 12px;
    color: #4f6070;
}
label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}
input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    font-size: 15px;
    box-sizing: border-box;
}
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    font-size: 15px;
    background: var(--card);
    box-sizing: border-box;
}
.input-wrap {
    position: relative;
}
.input-wrap input {
    padding-right: 42px;
}
.toggle-pass {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
}
.toggle-pass svg {
    width: 20px;
    height: 20px;
}
.toggle-pass .icon-off {
    display: none;
}
.toggle-pass.is-visible .icon-on {
    display: none;
}
.toggle-pass.is-visible .icon-off {
    display: inline;
}
.toggle-pass:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    border-radius: 6px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(31, 142, 173, 0.45);
    outline-offset: 2px;
    border-radius: 10px;
}
button {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--accent-2);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
}
.error {
    color: #b12c1b;
    margin-top: 10px;
}
.page-footer{margin-top:24px;padding:12px 0;border-top:1px solid #d9e0e6;text-align:center;color:#6b7785;font-size:12px;background:transparent;border-radius:0;}
a {
    color: var(--accent);
    text-decoration: none;
}
.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-weight: 600;
}
.remember input {
    width: auto;
    margin: 0;
}
.back-home {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: #334155;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .wrap {
        margin: 24px auto;
        padding: 16px;
    }
    .card {
        padding: 18px;
    }
    h1 {
        font-size: 22px;
    }
}
    
.brand-mark {
    background: transparent;
    color: transparent;
    font-weight: normal;
    letter-spacing: 0;
}
.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Stage 2 Public Refresh: visual-only (no behavior changes) */
body {
    background-image:
        radial-gradient(circle at 10% -10%, rgba(15, 127, 149, 0.12), transparent 35%),
        radial-gradient(circle at 98% 5%, rgba(205, 122, 37, 0.14), transparent 33%),
        linear-gradient(180deg, #f8f6f2 0%, #efebe3 100%);
    color: var(--ink);
}
.topbar {
    background: linear-gradient(120deg, #1d2a36 0%, #2b3843 52%, #364652 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(19, 29, 39, 0.24);
    padding-top: calc(env(safe-area-inset-top) + 14px);
}
.brand-title span:first-child,
h1,
h2 {
    font-family: "Futura", "Avenir Next", "Trebuchet MS", sans-serif;
    letter-spacing: 0.28px;
}
.brand-mark {
    border: none;
    border-radius: 0;
    box-shadow: none;
}
.wrap {
    margin-top: 34px;
}
.tabs {
    background: #fffefb;
    border-color: #d7ddd1;
    box-shadow: 0 12px 22px rgba(28, 41, 51, 0.08);
}
.tab.is-active {
    background: linear-gradient(180deg, #2b3945 0%, #1e2d39 100%);
    color: #ffffff;
}
.tab:not(.is-active):hover {
    color: #2c3a46;
}
.card {
    background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
    border-color: #d7dccf;
    box-shadow:
        0 16px 32px rgba(28, 41, 51, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.72) inset;
}
input,
select {
    background: #fffefb;
    border-color: #d3d8cd;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
input:hover,
select:hover {
    border-color: #c0c9bd;
}
input:focus,
select:focus {
    border-color: #83b5c0;
    box-shadow:
        0 0 0 3px rgba(15, 127, 149, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.72) inset;
}
button[type="submit"] {
    border-color: #0c6c7f;
    background: linear-gradient(180deg, #178ea6 0%, #0f7f95 100%);
    box-shadow: 0 7px 14px rgba(15, 127, 149, 0.24);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}
button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 127, 149, 0.28);
}
.back-home {
    background: #f4f7f1;
    border-color: #d7ddd2;
    color: #26333f;
}
.back-home:hover {
    background: #eaf0e7;
}
.error {
    color: #9f2c1f;
}
.page-footer {
    border-top-color: #d7ddd2;
}

/* Stage 4 UX polish */
.error {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #f5c7c0;
    background: #fff1ef;
    color: #9f2c1f;
    font-size: 14px;
    line-height: 1.4;
}
button[type="submit"]:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
button[type="submit"].is-loading {
    color: transparent;
    position: relative;
}
button[type="submit"].is-loading::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: loginSpin 0.75s linear infinite;
}
@keyframes loginSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Stage 5: accessibility + mobile hardening */
.tab,
.toggle-pass,
button[type="submit"],
.back-home {
    min-height: 44px;
}
.remember input {
    width: 20px;
    height: 20px;
}
.tabs-help {
    color: #485a6b;
}
.subtext {
    color: #4f6070;
}
@media (max-width: 390px) {
    .topbar {
        padding: 12px;
        padding-top: calc(env(safe-area-inset-top) + 12px);
    }
    .brand {
        gap: 10px;
    }
    .brand-mark {
        width: 32px;
        height: 32px;
    }
    .brand-title span:first-child {
        font-size: 14px;
    }
    .brand-title span:last-child {
        font-size: 11px;
    }
    .wrap {
        margin: 20px auto 32px;
        padding: 12px;
    }
    .tabs {
        padding: 3px;
    }
    .tab {
        font-size: 13px;
        padding: 10px 8px;
    }
    .card {
        padding: 16px;
    }
    h1 {
        font-size: 21px;
    }
    h2 {
        font-size: 18px;
    }
    input,
    select {
        font-size: 16px;
    }
}

/* Stage 6: typography consistency */
body {
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
}
h1 {
    font-size: var(--font-size-h1);
    line-height: var(--line-height-heading);
}
h2 {
    font-size: var(--font-size-h2);
    line-height: var(--line-height-heading);
}
.brand-title span:first-child {
    font-size: var(--font-size-body-lg);
}
.tab,
label,
button[type="submit"],
.back-home {
    font-size: var(--font-size-body);
}
input,
select {
    font-size: var(--font-size-body-lg);
}
.tabs-help,
.subtext,
.error {
    font-size: var(--font-size-body-sm);
}
.brand-title span:last-child,
.subtext-tight,
.page-footer {
    font-size: var(--font-size-caption);
}
