/* NexLingo public pages: policies, terms, support, account deletion, password reset. */
:root {
    color-scheme: light;
    --brand: #e03e00;
    --brand-600: #c23300;
    --brand-50: #fff4ed;
    --brand-100: #ffe4d4;
    --ink: #1f2933;
    --muted: #5f6b7a;
    --surface: #ffffff;
    --background: #f7f5f2;
    --border: #ece6e0;
    --success: #176b3a;
    --success-50: #ecf8f0;
    --error: #b42318;
    --error-50: #fef3f2;
    --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-wrap: anywhere;
}

/* Brand bar */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgb(255 255 255 / 92%);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(160%) blur(8px);
}
.site-header-inner {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.brand b { color: var(--brand); }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb36b, #ff6a1a 50%, #d63a00);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

/* Page card */
main {
    width: min(880px, calc(100% - 32px));
    margin: 28px auto;
    padding: 36px 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgb(31 41 51 / 6%);
}

/* Section tabs between the policy pages */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
nav a {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
nav a:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-600); }
nav a[aria-current="page"] { border-color: var(--brand); background: var(--brand); color: #fff; }

/* Text */
h1 {
    margin: 0 0 6px;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h2 {
    margin: 36px 0 10px;
    padding-left: 12px;
    border-left: 4px solid var(--brand);
    font-size: clamp(19px, 2.6vw, 22px);
    line-height: 1.35;
}
h3 { margin: 24px 0 8px; font-size: 17px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin: 6px 0; }
li::marker { color: var(--brand); }
a { color: var(--brand-600); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
strong { font-weight: 700; }
.muted { color: var(--muted); font-size: 15px; }

.notice {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--brand-100);
    border-left: 4px solid var(--brand);
    border-radius: 10px;
    background: var(--brand-50);
}

/* Tables (provider list): rows become cards on phones */
table {
    width: 100%;
    margin: 16px 0 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    font-size: 15px;
}
th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
th { background: var(--brand-50); color: var(--brand-600); font-size: 14px; font-weight: 700; }
td:first-child { width: 30%; font-weight: 700; }
tbody tr:nth-child(even) td { background: #fcfbfa; }

/* Forms (account deletion, password reset) */
form { margin: 8px 0 0; }
label { display: block; margin-bottom: 8px; font-weight: 700; }
input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d6cfc8;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 16px; /* 16px keeps iOS from zooming into the field */
    transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(224 62 0 / 15%); }
button {
    min-height: 48px;
    margin-top: 14px;
    padding: 12px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
button:hover { background: var(--brand-600); }
button:disabled { opacity: .6; cursor: wait; }

#result:not(:empty) { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f6f4f1; }
#result.success, .success { color: var(--success); }
#result.success { background: var(--success-50); }
#result.error, .error { color: var(--error); }
#result.error { background: var(--error-50); }

/* Footer */
.site-footer {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto 32px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}
.site-footer a { color: var(--muted); margin: 0 6px; }
.site-footer a:hover { color: var(--brand-600); }

/* Phones */
@media (max-width: 640px) {
    body { font-size: 15.5px; line-height: 1.65; }
    .site-header-inner { width: calc(100% - 32px); padding: 10px 0; }
    main {
        width: 100%;
        margin: 0;
        padding: 22px 16px 28px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    nav {
        flex-wrap: nowrap;
        margin: 0 -16px 22px;
        padding: 0 16px 14px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    nav::-webkit-scrollbar { display: none; }
    h2 { margin-top: 28px; }
    ul, ol { padding-left: 20px; }

    table, thead, tbody, tr, th, td { display: block; width: 100%; }
    table { border: 0; border-radius: 0; overflow: visible; }
    thead { display: none; }
    tr { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
    td { border-bottom: 0; padding: 10px 14px; }
    td:first-child { width: 100%; padding-bottom: 0; color: var(--brand-600); }
    tbody tr:nth-child(even) td { background: transparent; }

    button { width: 100%; }
    .site-footer { margin: 24px auto; }
    .site-footer a { display: inline-block; margin: 4px 6px; }
}
