/* Sevyncone UI: the colours, type and few components the platform's own pages share
   (portal, sign-in, service onboarding). No build step; allowed by a `style-src 'self'` policy. */

:root {
  color-scheme: light;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;

  --bg: #f3f6f3;
  --surface: #ffffff;
  --ink: #14231e;
  --ink-2: #55655f;
  --ink-3: #68776f;   /* placeholder and hairline labels: 4.7:1 on the white surface */
  --line: #dde5e0;
  --line-strong: #b9c7c0;
  --control-line: #7b8a82;  /* input borders: 3.6:1 on white, enough to see the field */

  --brand: #1e6b52;
  --brand-strong: #17543f;
  --brand-soft: #e9f3ee;
  --on-brand: #ffffff;
  --link: #1e6b52;

  --danger: #b3261e;
  --danger-ink: #7a1b15;
  --danger-soft: #fdf1f0;
  --danger-line: #f1c4c0;
  --info-soft: #eef5f1;
  --info-line: #cfe2d8;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 35, 30, .04), 0 12px 32px rgba(20, 35, 30, .07);
  --focus: 0 0 0 3px rgba(30, 107, 82, .28);
  --focus-color: #1e6b52;  /* keyboard focus outline: 6.4:1 on white */
}

/* Direction B of the first mock-up: neutral ink, green kept for links only. */
[data-theme="b"] {
  --bg: #f5f5f3;
  --ink: #161616;
  --ink-2: #5c5c5c;
  --ink-3: #6f6f6f;
  --line: #e3e3e0;
  --line-strong: #c4c4c0;
  --brand: #161616;
  --brand-strong: #000000;
  --brand-soft: #efefec;
  --info-soft: #f1f1ee;
  --info-line: #dcdcd8;
  --focus: 0 0 0 3px rgba(22, 22, 22, .22);
  --focus-color: #161616;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  word-break: keep-all;        /* Korean: break between words, not inside them */
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 3px; }

/* Brand */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-size: 20px; font-weight: 700; letter-spacing: -.02em;
}
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { fill: none; stroke: var(--on-brand); stroke-width: 2.6; stroke-linecap: round; }

/* Sign-in layout: one centred card */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 40px 20px 32px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.03em; }
.lede { margin: 0 0 24px; color: var(--ink-2); font-size: 15px; }
.auth-card .reference { margin: 16px 0 0; color: var(--ink-2); font-size: 12px; text-align: center; }
.auth-switch { margin: 20px 0 0; text-align: center; color: var(--ink-2); font-size: 15px; }
.auth-switch a { font-weight: 600; }
.auth-services { margin: 0; max-width: 420px; text-align: center; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.auth-services b { color: var(--ink); font-weight: 600; }
.auth-services span { white-space: nowrap; }
.auth-legal { color: var(--ink-2); font-size: 13px; }
.auth-legal a { color: inherit; }
/* The sign-in page's two halves. Below 1024px the brand panel is not shown and the page is the single card. */
.auth-main { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.auth-brand { display: none; }
.signed-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: -8px 0 20px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--bg); font-size: 14px; }
.signed-in span { color: var(--ink-2); }
.signed-in b { font-weight: 600; overflow-wrap: anywhere; }
.step-title { margin: 0 0 6px; font-size: 18px; line-height: 1.4; letter-spacing: -.02em; }
.step > .field-hint { margin-bottom: 16px; }
@media (min-width: 1024px) {
  .auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 0; padding: 0; }
  /* Like the services' own start pages: a deep green brand half, the card on the light half. */
  .auth-brand { display: flex; flex-direction: column; gap: 56px; padding: 48px 56px; background: #1f3f31; color: #dfe9e3; }
  .auth-brand .brand { color: #ffffff; }
  .auth-brand .brand-mark rect { fill: #f5f2ea; }
  .auth-brand .brand-mark path { stroke: #1f3f31; }
  .auth-brand-copy { margin-top: auto; margin-bottom: auto; max-width: 480px; }
  .auth-eyebrow { margin: 0 0 14px; color: #9fcfb4; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
  .auth-headline { margin: 0 0 14px; color: #ffffff; font-size: clamp(32px, 3.2vw, 42px); font-weight: 700; line-height: 1.2; letter-spacing: -.045em; }
  .auth-headline span { color: #9fd3b6; }
  .auth-brand-lede { margin: 0 0 28px; color: #c3d3ca; font-size: 15px; }
  .auth-service-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
  .auth-service-list li { display: flex; align-items: center; gap: 10px; min-width: 0; color: #ffffff; font-size: 15px; font-weight: 600; }
  .auth-service-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: rgb(255 255 255 / 8%); }
  .auth-service-icon svg { width: 18px; height: 18px; fill: none; stroke: #cfe5d8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .auth-main { justify-content: center; padding: 40px 32px; }
  .auth-main > .brand, .auth-main > .auth-services { display: none; }
}

/* Which service the visitor is on the way to */
.context {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 16px; padding: 6px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--ink); font-size: 13px;
}
.context b { font-weight: 700; }
.context-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn:focus-visible { border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--bg); }
/* Google's own button: white, its outline and ink colours, the four-colour mark. */
.btn-google { background: #ffffff; border-color: #747775; color: #1f1f1f; font-weight: 500; }
.btn-google:hover { background: #f8faf9; }
.btn-google svg { width: 18px; height: 18px; flex: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* A button that reads as a link (secondary actions inside a form) */
.link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--link); font: 500 13px/1.4 var(--font);
  text-decoration: underline; text-underline-offset: 3px;
}

/* Fields */
.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field-label { font-size: 14px; font-weight: 600; }
/* A field with a small action beside its label: shown top right, but placed after the input in the
   document so the keyboard order stays field first, action second. */
.field-with-action { grid-template-columns: 1fr auto; align-items: baseline; }
.field-with-action > * { grid-column: 1 / -1; }
.field-with-action > .field-label { grid-column: 1; grid-row: 1; }
.field-with-action > .field-action { grid-column: 2; grid-row: 1; }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--control-line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 16px var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: 2px solid var(--focus-color); outline-offset: 2px; border-color: var(--brand); }
.input:disabled { background: var(--bg); color: var(--ink-2); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { outline-color: var(--danger); }
.input-group { position: relative; }
.input-group .input { padding-right: 64px; }
.input-action {
  position: absolute; top: 6px; right: 6px; height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--ink-2); font: 600 13px var(--font);
}
.input-action:hover { background: var(--bg); }
.field-hint { margin: 0; color: var(--ink-2); font-size: 13px; }
.field-error { margin: 0; color: var(--danger); font-size: 13px; }
.step { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.secret { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; }
.retry { margin: 0 0 16px; }
select.input { appearance: auto; }
.consent { margin: 4px 0 16px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }

/* "or" between the two ways to sign in */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--ink-3); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Messages */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 20px; padding: 12px 14px;
  border: 1px solid; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.55;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.alert-error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.alert-info { background: var(--info-soft); border-color: var(--info-line); color: var(--ink); }

@media (max-width: 480px) {
  .auth { justify-content: flex-start; gap: 16px; padding: 28px 16px 24px; }
  .auth-card { padding: 24px 20px; border-radius: 14px; }
  .auth-card h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .btn[aria-busy="true"]::before { animation-duration: 2s; }
}

/* ---- Site frame (terms, privacy) and the account menu; the portal home's own layout is home.css ---- */
.site { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.site-bar { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.site-actions { display: flex; align-items: center; gap: 8px; }
.site-actions .btn { min-height: 40px; padding: 0 16px; font-size: 15px; }
.site-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 48px 24px 56px; }
.site-footer { max-width: 1120px; width: 100%; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 13px; }
.site-footer a { color: inherit; }

.menu { position: relative; }
.menu-button { list-style: none; display: inline-flex; align-items: center; gap: 8px; max-width: 280px; min-height: 40px; padding: 0 12px 0 6px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 600; }
.menu-button::-webkit-details-marker { display: none; }
.menu-button:hover { background: var(--bg); }
.menu-button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.menu-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); flex: none; position: relative; }
.menu-avatar::before { content: ""; position: absolute; left: 9px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.menu-avatar::after { content: ""; position: absolute; left: 5px; top: 18px; width: 18px; height: 10px; border-radius: 9px 9px 0 0; background: var(--brand); clip-path: inset(0 0 4px 0); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.menu-label { margin: 8px 10px 0; color: var(--ink-2); font-size: 12px; }
.menu-account { margin: 0 10px 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.menu-item { display: block; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: none; text-align: left;
  color: var(--ink); font: 500 14px/1.4 var(--font); text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--bg); }
.menu-item:disabled { opacity: .5; cursor: wait; }

@media (max-width: 560px) {
  .site-bar { padding: 12px 16px; min-height: 60px; }
  .site-main { padding: 32px 16px 40px; }
  .site-footer { padding: 20px 16px; }
  .site-actions .btn { padding: 0 12px; }
  .menu-button { max-width: 180px; }
}

/* ---- Terms and privacy ---- */
.legal { max-width: 760px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.75; }
.legal h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 34px); line-height: 1.25; letter-spacing: -.03em; }
.legal h2 { margin: 36px 0 8px; font-size: 20px; letter-spacing: -.02em; }
.legal h3 { margin: 24px 0 6px; font-size: 17px; }
.legal p, .legal li { color: var(--ink); font-size: 15px; }
.legal li { margin: 4px 0; }
.legal table { display: block; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--bg); font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) { .legal { padding: 22px 18px; border-radius: 14px; } }
