:root {
    --ink: #18172a;
    --ink-soft: #55536c;
    --line: #e6e2f0;
    --paper: #fbfaff;
    --white: #fff;
    --violet: #6855e7;
    --violet-dark: #4d3bc0;
    --violet-soft: #eeeafd;
    --coral: #ff765f;
    --mint: #41bfa0;
    --yellow: #ffd866;
    --shadow: 0 18px 55px rgb(52 42 118 / 12%);
    --content: 1120px;
    --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
        "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font);
    line-height: 1.58;
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
label {
    -webkit-tap-highlight-color: transparent;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 9px 12px;
    color: white;
    background: var(--ink);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    z-index: 30;
    top: 0;
    border-bottom: 1px solid rgb(24 23 42 / 7%);
    background: rgb(251 250 255 / 86%);
    backdrop-filter: blur(18px);
}

.nav {
    display: flex;
    width: min(calc(100% - 40px), var(--content));
    min-height: 66px;
    margin: auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-mark {
    display: grid;
    width: 35px;
    height: 35px;
    border-radius: 12px 12px 12px 4px;
    color: white;
    background: linear-gradient(145deg, var(--violet), #8775f1);
    font-size: 14px;
    place-items: center;
    box-shadow: 0 7px 18px rgb(104 85 231 / 25%);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link,
.balance-chip {
    padding: 8px 11px;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 750;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--violet-dark);
    background: var(--violet-soft);
}

.balance-chip {
    border: 1px solid var(--line);
    color: var(--violet-dark);
    background: white;
}

.account-menu {
    position: relative;
}

.account-summary {
    display: flex;
    max-width: 210px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--ink-soft);
    background: white;
    list-style: none;
}

.account-summary::-webkit-details-marker {
    display: none;
}

.account-provider {
    color: var(--violet-dark);
    font-size: 11px;
    font-weight: 850;
}

.account-name {
    overflow: hidden;
    font-size: 13px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-popover {
    position: absolute;
    z-index: 50;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    width: min(300px, calc(100vw - 24px));
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    gap: 9px;
    background: white;
    box-shadow: 0 18px 50px rgb(24 23 42 / 16%);
}

.account-menu:not([open]) .account-popover {
    display: none;
}

.account-signed-in,
.account-status {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.account-email {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-report-link,
.account-logout {
    min-height: 40px;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}

.account-report-link {
    color: var(--violet-dark);
    background: var(--violet-soft);
}

.account-logout {
    color: var(--ink-soft);
    background: #f2f0f7;
}

.account-status {
    color: #b54242;
}

.container {
    width: min(calc(100% - 40px), var(--content));
    margin-inline: auto;
}

.narrow {
    width: min(calc(100% - 32px), 720px);
    margin-inline: auto;
}

.page-main {
    min-height: calc(100vh - 66px);
    padding: 54px 0 90px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.18;
    letter-spacing: -0.048em;
}

h1 {
    font-size: clamp(38px, 7vw, 72px);
}

h2 {
    font-size: clamp(28px, 4.5vw, 44px);
}

h3 {
    font-size: 21px;
}

.eyebrow {
    display: inline-flex;
    margin: 0 0 15px;
    padding: 7px 11px;
    border-radius: 999px;
    align-items: center;
    gap: 7px;
    color: var(--violet-dark);
    background: var(--violet-soft);
    font-size: 13px;
    font-weight: 850;
}

.eyebrow::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral);
    content: "";
}

.muted {
    color: var(--ink-soft);
}

.card {
    border: 1px solid rgb(63 53 115 / 10%);
    border-radius: 24px;
    background: rgb(255 255 255 / 94%);
    box-shadow: 0 6px 24px rgb(52 42 118 / 6%);
}

.panel {
    padding: clamp(22px, 5vw, 38px);
}

.button {
    display: inline-flex;
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 15px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 850;
    letter-spacing: -0.025em;
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.55;
    transform: none;
}

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--violet), var(--violet-dark));
    box-shadow: 0 12px 25px rgb(104 85 231 / 25%);
}

.button-secondary {
    border: 1px solid var(--line);
    color: var(--ink);
    background: white;
}

.button-block {
    width: 100%;
}

.stack {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
}

.field label,
.field-label {
    font-size: 14px;
    font-weight: 800;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 52px;
    padding: 13px 14px;
    border: 1px solid #dcd7e8;
    border-radius: 13px;
    outline: none;
    color: var(--ink);
    background: white;
}

.textarea {
    min-height: 145px;
    resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgb(104 85 231 / 12%);
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink-soft);
    font-size: 13px;
}

.checkbox input {
    margin-top: 4px;
}

.status-box {
    padding: 13px 15px;
    border-radius: 13px;
    color: var(--violet-dark);
    background: var(--violet-soft);
    font-size: 14px;
    font-weight: 700;
}

.status-box.is-error {
    color: #9c382d;
    background: #ffebe7;
}

.site-footer {
    padding: 34px 0;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    background: white;
    font-size: 13px;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.footer-inner p {
    margin-bottom: 5px;
}

.footer-links {
    display: flex;
    margin-bottom: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
    color: var(--ink);
    font-weight: 700;
}

.legal-page {
    padding: 56px 0 90px;
}

.legal-page h1 {
    margin-bottom: 10px;
}

.legal-section {
    margin-top: 38px;
}

.legal-section h2 {
    font-size: 23px;
}

.legal-section p,
.legal-section li {
    color: var(--ink-soft);
}

@media (max-width: 700px) {
    .nav {
        width: min(calc(100% - 24px), var(--content));
    }

    .nav-link.optional {
        display: none;
    }

    .balance-chip {
        padding-inline: 9px;
    }

    .account-summary {
        max-width: 112px;
        padding-inline: 8px;
    }

    .account-name {
        max-width: 58px;
    }

    .container {
        width: min(calc(100% - 28px), var(--content));
    }

    .page-main {
        padding-top: 36px;
    }

    .footer-inner {
        display: grid;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
