/* ==========================================================================
   pages.css — self-contained styling for the standalone pages that do NOT
   extend layout.pug: policy, terms of service, change password, error.
   Carries its own design tokens so each page needs only this one stylesheet.
   ========================================================================== */

:root {
    --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --surface-0: #171a2e;
    --surface-1: #20243d;
    --surface-2: #262b47;
    --field-bg: #161a30;
    --border-soft: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text-1: #eef1f8;
    --text-2: #b9c0d4;
    --text-3: #90a3bb;
    --accent: #3d8bfd;
    --accent-hover: #5f9ffd;
    --accent-press: #2f74d8;
    --warn: #ffb38a;
    --danger: #ff6b6b;
    --ring: 0 0 0 3px rgba(61, 139, 253, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.static-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    font-family: var(--ui-font);
    color: var(--text-1);
    background: linear-gradient(-135deg, #232a4d, var(--surface-0));
    background-attachment: fixed;
    line-height: 1.6;
}

/* ----- Document card (policy / terms) ----------------------------------- */

.static-card {
    width: 100%;
    max-width: 760px;
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 40px 44px 32px;
}

.static-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-hover);
    margin-bottom: 18px;
}

.static-brand::before {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--accent);
}

.static-title {
    font-family: var(--ui-font);
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-1);
}

.static-updated {
    margin: 0 0 28px;
    font-size: 13px;
    color: var(--text-3);
}

.static-section {
    margin: 0 0 24px;
}

.static-section h2 {
    font-family: var(--ui-font);
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-1);
}

.static-section p,
.static-section li {
    margin: 0 0 8px;
    font-size: 14.5px;
    color: var(--text-2);
}

.static-section ul {
    margin: 0 0 8px;
    padding-left: 20px;
}

.static-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-3);
}

.static-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9fc3ff;
    text-decoration: none;
    font-weight: 500;
}

.static-back:hover {
    color: #cfe2ff;
    text-decoration: underline;
}

/* ----- Form card (change password) -------------------------------------- */

.form-card {
    width: 100%;
    max-width: 440px;
    margin-top: 6vh;
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 36px 36px 32px;
}

.form-card .static-title {
    text-align: center;
    margin-bottom: 6px;
}

.form-card .form-sub {
    text-align: center;
    margin: 0 0 26px;
    font-size: 14px;
    color: var(--text-2);
}

.field {
    margin: 0 0 18px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}

.field input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-family: var(--ui-font);
    font-size: 14px;
    color: var(--text-1);
    background: var(--field-bg);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
    color: #6b7390;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.field input:read-only {
    color: var(--text-3);
    background: #12152a;
    cursor: not-allowed;
}

.form-status {
    min-height: 20px;
    margin: 2px 0 12px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: var(--warn);
}

.btn-primary {
    display: block;
    width: 100%;
    height: 46px;
    font-family: var(--ui-font);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    background: var(--accent-press);
    transform: translateY(1px);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* ----- Error page ------------------------------------------------------- */

.error-card {
    width: 100%;
    max-width: 560px;
    margin-top: 8vh;
    text-align: center;
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 40px 40px 32px;
}

.error-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    font-size: 30px;
    border-radius: 50%;
    color: var(--danger);
    background: rgba(255, 107, 107, 0.12);
}

.error-card h1 {
    font-family: var(--ui-font);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text-1);
}

.error-card .error-msg {
    margin: 0 0 6px;
    font-size: 15px;
    color: var(--text-2);
}

.error-card .error-help {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--text-3);
}

.error-card .error-help a {
    color: #9fc3ff;
}

.error-details {
    margin-top: 22px;
    text-align: left;
}

.error-details summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-3);
    user-select: none;
}

.error-details pre {
    margin: 12px 0 0;
    padding: 14px;
    max-height: 280px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.5;
    color: #b9c0d4;
    background: var(--field-bg);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 520px) {
    .static-card,
    .form-card,
    .error-card {
        padding-left: 22px;
        padding-right: 22px;
    }
}
