/* ARD Identity surface — tokens + components
 *
 * Ported from docs/landing-page-imagery/.../styles/tokens.css (claude.ai/design
 * handoff, 2026-04-25). Defines the brand-level visual register for
 * pre-authenticated marketing + identity surfaces (landing, signup, login,
 * register). Scoped to the .identity-surface root class so it doesn't pollute
 * the rest of the app (which uses the @ard/tokens member/shopper/operator
 * registers via Tailwind).
 *
 * Premium restrained patriotic — NOT the member dramatic register.
 */

.identity-surface {
  /* Brand — picked from logo */
  --ard-red:        #A51A1A;
  --ard-red-deep:   #871414;
  --ard-red-soft:   #C53030;
  --ard-blue:       #1C4E80;
  --ard-blue-deep:  #133657;
  --ard-blue-soft:  #2563A8;

  /* Surface — warm cream */
  --cream:          #FAF7F2;
  --cream-2:        #F4EFE6;
  --cream-3:        #ECE5D7;
  --paper:          #FFFFFF;

  /* Ink + greys */
  --ink:            #14110D;
  --ink-2:          #2A2620;
  --muted:          #6B6357;
  --muted-2:        #8A8377;
  --hairline:       #E1D9C9;
  --hairline-2:     #D2C8B4;

  /* Functional */
  --danger:         #B91C1C;
  --danger-bg:      #FEF2F2;
  --success:        #166534;
  --warn:           #92400E;

  /* Type */
  --font-sans:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display:   "Oswald", "Inter", sans-serif;
  --font-mono:      "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Radii + shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(20, 17, 13, 0.06);
  --shadow-md: 0 6px 24px -8px rgba(20, 17, 13, 0.12), 0 2px 6px rgba(20, 17, 13, 0.04);
  --shadow-lg: 0 20px 48px -16px rgba(20, 17, 13, 0.18), 0 8px 16px -8px rgba(20, 17, 13, 0.08);

  font-family: var(--font-sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Eyebrow / micro */
.identity-surface .ard-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--ard-red);
}
.identity-surface .ard-eyebrow--blue { color: var(--ard-blue); }
.identity-surface .ard-eyebrow--ink  { color: var(--ink-2); }

/* Display */
.identity-surface .ard-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  line-height: 0.96;
  color: var(--ink);
}

/* Brand hairline — star + rule */
.identity-surface .ard-stripe {
  position: relative;
  display: block;
  height: 14px;
  background:
    linear-gradient(to right, transparent 0, transparent 24px, var(--ard-red) 24px, var(--ard-red) 100%) center / 100% 1.5px no-repeat;
}
.identity-surface .ard-stripe::before {
  content: "★";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  color: var(--ard-blue);
  font-size: 14px;
  line-height: 1;
}
.identity-surface .ard-stripe--thin { height: 12px; }
.identity-surface .ard-stripe--thin::before { font-size: 12px; }

/* Buttons */
.identity-surface .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 14px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms, color 120ms, box-shadow 120ms, transform 80ms;
  text-decoration: none;
  white-space: nowrap;
}
.identity-surface .btn:active { transform: translateY(0.5px); }
.identity-surface .btn:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--ard-blue) 35%, transparent);
  outline-offset: 2px;
}

.identity-surface .btn--primary {
  background: var(--ard-red);
  color: #FFF;
  border-color: var(--ard-red);
  box-shadow: 0 1px 2px rgba(132, 18, 18, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.identity-surface .btn--primary:hover { background: var(--ard-red-deep); border-color: var(--ard-red-deep); }
.identity-surface .btn--primary:disabled,
.identity-surface .btn--primary[aria-disabled="true"] {
  background: var(--hairline-2);
  border-color: var(--hairline-2);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.identity-surface .btn--secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline-2);
}
.identity-surface .btn--secondary:hover { background: var(--cream-2); border-color: var(--muted-2); }

.identity-surface .btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}
.identity-surface .btn--ghost:hover { background: var(--cream-2); }

.identity-surface .btn--blue {
  background: var(--ard-blue);
  color: #FFF;
  border-color: var(--ard-blue);
}
.identity-surface .btn--blue:hover { background: var(--ard-blue-deep); border-color: var(--ard-blue-deep); }

.identity-surface .btn--lg { font-size: 16px; padding: 16px 24px; }
.identity-surface .btn--block { width: 100%; }

/* Spinner */
.identity-surface .btn .spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: identity-spin 0.7s linear infinite;
}
@keyframes identity-spin { to { transform: rotate(360deg); } }

/* Form fields */
.identity-surface .field { display: flex; flex-direction: column; gap: 6px; }
.identity-surface .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) {
  .identity-surface .field-row { grid-template-columns: 1fr; }
}

.identity-surface .field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.identity-surface .field-label .opt {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.identity-surface .input {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
.identity-surface .input::placeholder { color: var(--muted-2); }
.identity-surface .input:hover { border-color: var(--muted-2); }
.identity-surface .input:focus {
  outline: none;
  border-color: var(--ard-blue);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ard-blue) 18%, transparent);
}
.identity-surface .input:disabled {
  background: var(--cream-2);
  color: var(--muted);
  cursor: not-allowed;
}

.identity-surface .field--invalid .input {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.identity-surface .field--invalid .input:focus {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 18%, transparent);
}

.identity-surface .field-help { font-size: 12.5px; color: var(--muted); }
.identity-surface .field-error {
  font-size: 12.5px;
  color: var(--danger);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* Input with affix (like phone country code) */
.identity-surface .input-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-md);
  background: var(--paper);
  overflow: hidden;
  transition: border-color 120ms, box-shadow 120ms;
}
.identity-surface .input-affix:focus-within {
  border-color: var(--ard-blue);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ard-blue) 18%, transparent);
}
.identity-surface .input-affix .input {
  border: none;
  border-radius: 0;
  background: transparent;
}
.identity-surface .input-affix .input:focus { box-shadow: none; }
.identity-surface .input-affix .affix {
  display: flex;
  align-items: center;
  padding: 0 12px 0 14px;
  font-size: 14px;
  color: var(--muted);
  border-right: 1px solid var(--hairline);
  background: var(--cream-2);
}

/* Native <select> styled to match .input — custom chevron, OS arrow removed */
.identity-surface select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%236B6357' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.identity-surface select.input:disabled { cursor: not-allowed; }
/* Empty default option shown dimmed, like an <input> placeholder. */
.identity-surface select.input.is-placeholder { color: var(--muted-2); }

/* Phone: country-code <select> + national number share one row. */
.identity-surface .input-group { display: flex; align-items: stretch; gap: 8px; }
.identity-surface .input-group .phone-cc { flex: 0 0 44%; min-width: 0; }
.identity-surface .input-group .phone-national { flex: 1 1 auto; min-width: 0; }

/* Date of birth: month / day / year selects in one row. */
.identity-surface .dob-group { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 8px; }
.identity-surface .dob-group .dob-select { padding-right: 30px; background-position: right 10px center; }
@media (max-width: 380px) {
  .identity-surface .dob-group { grid-template-columns: 1fr; }
}

/* Checkbox */
.identity-surface .checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
  cursor: pointer;
}
.identity-surface .checkbox input {
  appearance: none;
  width: 18px; height: 18px;
  margin: 1px 0 0;
  border: 1.5px solid var(--hairline-2);
  border-radius: 4px;
  background: var(--paper);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 120ms, border-color 120ms;
}
.identity-surface .checkbox input:hover { border-color: var(--muted-2); }
.identity-surface .checkbox input:checked {
  background: var(--ard-blue);
  border-color: var(--ard-blue);
}
.identity-surface .checkbox input:checked::after {
  content: "";
  position: absolute;
  top: 2px; left: 5px;
  width: 4px; height: 9px;
  border: solid #FFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.identity-surface .checkbox input:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--ard-blue) 35%, transparent);
  outline-offset: 2px;
}

/* Banner / inline alert */
.identity-surface .alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid;
}
.identity-surface .alert--danger {
  background: var(--danger-bg);
  color: #7F1D1D;
  border-color: #FECACA;
}
.identity-surface .alert .alert-icon { font-size: 16px; line-height: 1.2; flex-shrink: 0; }
.identity-surface .alert strong { display: block; margin-bottom: 2px; }

/* Card */
.identity-surface .identity-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 24px 56px -16px rgba(0, 0, 0, 0.55),
    0 8px 24px -8px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
}

/* Identity frame — dark navy backdrop the white card floats on.
 * Mirrors the IdentityFrame component in the original design canvas
 * (docs/landing-page-imagery/.../ARD Community.html lines 36-87).
 * Red wash from the upper-left, purple from the lower-right, navy
 * vertical gradient, faint star/grain texture on top.
 */
.identity-surface .identity-frame {
  position: relative;
  min-height: 100vh;
  padding: 44px 20px 56px;
  background: #0B1530;
  display: flex;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
}
.identity-surface .identity-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 70% 55% at 0% 30%, rgba(165, 26, 26, 0.55), transparent 60%),
    radial-gradient(ellipse 70% 60% at 100% 70%, rgba(76, 56, 168, 0.55), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(28, 78, 128, 0.45), transparent 65%),
    linear-gradient(180deg, #0E1A38 0%, #0A1228 60%, #08101F 100%);
}
.identity-surface .identity-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 78% 28%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 38% 72%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 88%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(1px 1px at 22% 92%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 64% 12%, rgba(255,255,255,0.45), transparent 60%);
}
.identity-surface .identity-frame > * {
  position: relative;
  z-index: 1;
}

/* Frame inner column — caps width of the card on wide viewports. */
.identity-surface .identity-frame__column {
  width: 100%;
  max-width: 460px;
}

/* Frame footer — small reassurance line under the card.
 * "Protected by Cloudflare Turnstile · One identity for community,
 *  store, and wallet."
 */
.identity-surface .identity-frame__footer {
  margin-top: 28px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  max-width: 380px;
}
.identity-surface .identity-card .card-body { padding: 36px 36px 32px; }
@media (max-width: 640px) {
  .identity-surface .identity-card .card-body { padding: 28px 22px 26px; }
}

/* Turnstile slot — Cloudflare widget container.
 * Holds the real Turnstile widget; spacing matches the rest of the form.
 */
.identity-surface .turnstile-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

/* Logo lockup */
.identity-surface .brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.identity-surface .brand-mark img { display: block; }
.identity-surface .brand-mark .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 17px;
  color: var(--ink);
  line-height: 1;
}
.identity-surface .brand-mark .wordmark .red  { color: var(--ard-red); }
.identity-surface .brand-mark .wordmark .blue { color: var(--ard-blue); }
.identity-surface .brand-mark .wordmark .sub  {
  display: block;
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 4px;
}
