/* Hallmark · macrostructure: Split Studio · tone: terang dan ramah · anchor hue: green
 * theme: Garden · nav: N1a (dua tujuan autentikasi) · footer: Ft2
 * enrichment: foto sekolah yang sudah tersedia · motion: button press
 * Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4
 */
@import url("../../tokens.css");

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; min-height: 100svh; overflow-x: clip; background: var(--color-paper); color: var(--color-ink); font: var(--text-base)/1.6 var(--font-body); }
button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: var(--color-mint); }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--color-accent); text-underline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { min-width: 0; overflow-wrap: anywhere; font-family: var(--font-display); font-style: normal; letter-spacing: -0.045em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 4px; }
.auth-container { width: min(100%, 1232px); margin-inline: auto; padding-inline: var(--space-lg); }
.auth-header { padding-block: var(--space-lg); }
.auth-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.auth-brand { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-ink); text-decoration: none; }
.auth-brand img { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.auth-brand strong { display: block; font: 800 var(--text-sm)/1.4 var(--font-display); letter-spacing: -0.02em; }
.auth-brand small { display: block; color: var(--color-muted); font-size: 0.75rem; }
.auth-nav { display: flex; align-items: center; gap: var(--space-lg); }
.auth-nav a { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; white-space: nowrap; font-size: var(--text-sm); font-weight: 600; text-decoration: none; }
.auth-layout { display: grid; gap: var(--space-xl); padding-block: var(--space-xl); }
.auth-story { display: none; }
.auth-content { min-width: 0; width: min(100%, 440px); margin-inline: auto; }
.auth-content--register { width: min(100%, 560px); }
.auth-heading { margin-bottom: var(--space-xl); }
.auth-heading h1 { font-size: var(--text-xl); line-height: 1.25; font-weight: 800; }
.auth-heading p { color: var(--color-muted); margin-top: var(--space-sm); max-width: 44ch; }
.auth-form { display: grid; gap: var(--space-lg); }
.auth-field { min-width: 0; display: grid; align-content: start; gap: var(--space-sm); }
.auth-field label { font-size: var(--text-sm); font-weight: 600; }
.auth-required { color: var(--color-error); }
.auth-input { display: block; width: 100%; min-width: 0; min-height: 52px; border: var(--rule-width) solid var(--color-input-rule); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-ink); padding: 12px var(--space-md); line-height: 1.5; }
select.auth-input { height: 52px; min-height: 52px; padding: 12px 2.75rem 12px var(--space-md); -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2313442c' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--space-md) center; background-size: 16px; font-family: var(--font-body); font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
select.auth-input option { font-family: var(--font-body); font-size: 16px; }
.auth-input::placeholder { color: var(--color-muted); opacity: 1; }
.auth-input:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-input:focus { border-color: var(--color-accent); outline: 2px solid var(--color-focus); outline-offset: 2px; }
.auth-input[aria-invalid="true"] { border-color: var(--color-error); }
.auth-password { position: relative; }
.auth-password input { padding-inline-end: 76px; }
.auth-password__toggle { position: absolute; inset-block: 4px; inset-inline-end: 4px; min-width: 60px; border: 0; border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-accent); font-size: var(--text-sm); font-weight: 600; }
.auth-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); width: 100%; min-height: 52px; padding: 12px var(--space-lg); border: var(--rule-width) solid var(--color-accent); border-radius: var(--radius-sm); background: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform var(--dur-micro) var(--ease-out); }
.auth-button:active:not(:disabled) { transform: translateY(1px); }
.auth-button:disabled { opacity: 0.65; cursor: wait; }
.auth-button--secondary { background: var(--color-paper); color: var(--color-accent); }
.auth-switch { display: grid; gap: var(--space-md); margin-top: var(--space-xl); padding-top: var(--space-xl); border-top: var(--rule-width) solid var(--color-rule); }
.auth-switch p { font-size: var(--text-sm); color: var(--color-muted); text-align: center; }
.auth-switch p a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.auth-help { margin-top: var(--space-lg); font-size: var(--text-sm); color: var(--color-muted); }
.auth-help a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; font-weight: 600; }
.auth-flash:not(:empty), .auth-status { margin-bottom: var(--space-lg); }
.auth-flash .alert, .auth-status { padding: var(--space-md); border-radius: var(--radius-sm); background: var(--color-error-paper); color: var(--color-error); font-size: var(--text-sm); overflow-wrap: anywhere; }
.auth-flash .alert-success { background: var(--color-mint); color: var(--color-accent); }
.auth-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-group legend { width: 100%; padding: 0; margin-bottom: var(--space-md); font-weight: 600; font-size: var(--text-base); }
.auth-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
.auth-fields--identity { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-field--wide { grid-column: 1 / -1; }
.auth-field__hint { font-size: var(--text-sm); color: var(--color-muted); }
.auth-nik-help { border: var(--rule-width) solid var(--color-rule); border-radius: var(--radius-sm); background: var(--color-soft); overflow: hidden; }
.auth-nik-help summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 44px; padding: var(--space-sm) var(--space-md); color: var(--color-accent); font-weight: 600; cursor: pointer; list-style: none; }
.auth-nik-help summary::-webkit-details-marker { display: none; }
.auth-nik-help summary::after { content: "+"; flex: 0 0 auto; font-size: 1.25em; line-height: 1; }
.auth-nik-help[open] summary::after { content: "−"; }
.auth-nik-help p { padding: 0 var(--space-md) var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.auth-nik-help img { display: block; width: calc(100% - var(--space-md) - var(--space-md)); max-width: 600px; height: auto; margin: 0 var(--space-md) var(--space-md); border: var(--rule-width) solid var(--color-rule); border-radius: var(--radius-sm); }
.auth-contact-note { margin-top: var(--space-md); color: var(--color-muted); font-size: var(--text-sm); }
.auth-captcha { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--space-sm); min-width: 0; padding: var(--space-md); border: var(--rule-width) solid var(--color-rule); border-radius: var(--radius-sm); background: var(--color-soft); text-align: center; }
.g-recaptcha { width: 304px; min-height: 78px; }
.auth-captcha p { color: var(--color-muted); font-size: var(--text-sm); }
.auth-captcha .auth-captcha__title { color: var(--color-ink); font-weight: 600; }
.auth-submit-note { text-align: center; color: var(--color-muted); font-size: var(--text-sm); }
.auth-success { display: grid; gap: var(--space-lg); }
.auth-success h2 { font-size: var(--text-xl); line-height: 1.3; }
.auth-success__mark { justify-self: center; color: var(--color-accent); width: 72px; height: 72px; padding: var(--space-sm); border-radius: 50%; background: var(--color-mint); animation: auth-success-pop 500ms var(--ease-out) both; }
.auth-success__mark circle, .auth-success__mark path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.auth-success__mark circle { animation: auth-success-draw 450ms var(--ease-out) 100ms both; }
.auth-success__mark path { animation: auth-success-draw 300ms var(--ease-out) 400ms both; }
@keyframes auth-success-pop {
  from { opacity: 0; transform: scale(0.65); }
  70% { opacity: 1; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes auth-success-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.auth-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-md); padding-block: var(--space-sm); border-top: var(--rule-width) solid var(--color-rule); color: var(--color-muted); font-size: var(--text-sm); }
.auth-footer p { max-width: 100%; }
.auth-dialog { position: fixed; inset: 0; margin: auto; width: min(480px, calc(100% - 32px)); height: fit-content; max-height: 85svh; padding: var(--space-xl); border: var(--rule-width) solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-paper); color: var(--color-ink); }
.auth-dialog::backdrop { background: var(--color-backdrop); }
.auth-dialog h2 { font-size: var(--text-md); line-height: 1.4; margin-bottom: var(--space-md); }
.auth-dialog p { font-size: var(--text-sm); overflow-wrap: anywhere; }
.auth-dialog__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-lg); }
.auth-dialog__actions button { flex: 1 1 120px; }
.auth-skip { position: fixed; top: var(--space-sm); left: var(--space-sm); padding: var(--space-md); background: var(--color-paper); color: var(--color-accent); z-index: 10; transform: translateY(-200%); }
.auth-skip:focus { transform: none; }

@media (max-width: 399px) {
  .auth-fields--identity .auth-field:not(.auth-field--wide) input.auth-input { padding-inline: var(--space-sm); }
  .g-recaptcha { zoom: 0.9; }
}
@media (max-width: 359px) {
  .g-recaptcha { zoom: 0.78; }
}

@media (hover: hover) {
  .auth-input:hover:not(:disabled) { background: var(--color-soft); color: var(--color-ink); }
  .auth-button:hover:not(:disabled) { background: var(--color-accent-hover); color: var(--color-accent-ink); }
  .auth-button--secondary:hover { background: var(--color-mint); color: var(--color-accent); }
  .auth-password__toggle:hover { background: var(--color-soft); color: var(--color-accent); }
  .auth-nav a:hover, .auth-help a:hover { text-decoration: underline; }
}
@media (min-width: 40rem) {
  .auth-container { padding-inline: var(--space-xl); }
  .auth-brand { gap: var(--space-md); }
  .auth-brand img { width: 52px; height: 52px; }
  .auth-brand strong { font-size: var(--text-base); }
  .auth-brand small { font-size: var(--text-sm); }
  .auth-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 62rem) {
  .auth-header { padding-block: var(--space-lg); }
  .auth-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: var(--space-4xl); padding-block: var(--space-xl) var(--space-2xl); }
  .auth-story { display: flex; flex-direction: column; min-width: 0; background: var(--color-mint); color: var(--color-ink); border-radius: var(--radius-lg); }
  .auth-story__copy { display: grid; gap: var(--space-lg); padding: 1.5rem var(--space-xl); }
  .auth-story h2 { max-width: 15ch; font-size: var(--text-display); font-weight: 800; line-height: 1.18; }
  .auth-story__copy > p { color: var(--color-muted); max-width: 38ch; }
  .auth-story__photo { position: relative; margin-top: auto; }
  .auth-story__photo img { display: block; width: 100%; height: 300px; object-fit: cover; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .auth-story__photo figcaption { position: absolute; bottom: var(--space-md); left: var(--space-md); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); background: var(--color-paper); color: var(--color-ink); font-size: var(--text-sm); }
  .auth-story__steps { display: grid; gap: var(--space-lg); margin: 0; padding: 0; list-style: none; counter-reset: admission; }
  .auth-story__steps li { position: relative; padding-inline-start: 44px; counter-increment: admission; }
  .auth-story__steps li::before { content: counter(admission, decimal-leading-zero); position: absolute; inset-inline-start: 0; inset-block-start: 0; color: var(--color-accent); font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
  .auth-story__steps strong { display: block; font-weight: 600; }
  .auth-story__steps span { display: block; color: var(--color-muted); font-size: var(--text-sm); }
  .auth-layout--register { align-items: start; gap: var(--space-2xl); }
  .auth-layout--register .auth-story__photo img { height: 260px; }
  .auth-content--register { padding-top: var(--space-sm); }
  .auth-footer { margin-top: var(--space-sm); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-success__mark, .auth-success__mark circle, .auth-success__mark path { animation: none; }
  .auth-button { transition: none; }
  .auth-button:active:not(:disabled) { transform: none; }
}
