* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
body { background: #FDF7F0; color: #1B1B1B; font: 400 16px/1.5 Inter, system-ui, sans-serif; position: relative; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.brand-world { position: fixed; inset: 0; overflow: clip; pointer-events: none; z-index: -1; background: #FDF7F0; }
.brand-world img { width: 100%; height: 100%; object-fit: cover; object-position: center; animation: world-enter 1600ms ease-out both; }
.page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 20px 24px; isolation: isolate; }
main { flex: 1; display: grid; place-items: center; width: 100%; padding: 48px 0 40px; }
.stack { position: relative; width: min(100%, 440px); isolation: isolate; }
.sheet { position: absolute; inset: 0; border: 1px solid #1B1B1B; border-radius: 20px; z-index: -1; pointer-events: none; transition: transform 220ms cubic-bezier(.23,1,.32,1); }
.sheet.back { background: #FFE7D0; transform: translate(-12px, -9px) rotate(-2deg); }
.sheet.base { background: #FC6E20; transform: translate(12px, 12px) rotate(1.5deg); }
.stack[data-focus="identifier"] .sheet.back { transform: translate(-16px, -12px) rotate(-2.5deg); }
.stack[data-focus="identifier"] .sheet.base { transform: translate(14px, 10px) rotate(1.7deg); }
.stack[data-focus="password"] .sheet.back { transform: translate(-10px, -10px) rotate(-1.6deg); }
.stack[data-focus="password"] .sheet.base { transform: translate(16px, 15px) rotate(2deg); }
.auth-card { background: #FFF; border: 1px solid #1B1B1B; border-radius: 16px; overflow: clip; box-shadow: 0 24px 56px #1B1B1B20, 0 4px 12px #1B1B1B12; transition: box-shadow 200ms cubic-bezier(.23,1,.32,1); }
.stack:focus-within .auth-card { box-shadow: 0 28px 64px #1B1B1B30, 0 4px 12px #1B1B1B14; }
.brand-header { background: #1B1B1B; min-height: 112px; padding: 16px 32px; display: grid; place-items: center; }
.brand-header .ffe-brand { min-height: 72px; gap: 10px; font-size: 24px; animation: logo-enter 280ms ease-out both; }
.brand-header .ffe-brand img { width: 64px; }
.brand-header p { color: #FFE7D0; font-size: 12px; line-height: 1.5; margin: 0; text-align: center; }
.content { padding: 28px 32px 24px; }
h1 { font-size: 30px; font-weight: 600; letter-spacing: -.04em; line-height: 1.2; margin: 0 0 8px; overflow-wrap: anywhere; }
.intro { font-size: 14px; color: #4A4A4A; margin: 0 0 24px; }
.field { position: relative; margin-bottom: 8px; }
.setup-field { margin-bottom: 24px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
input { width: 100%; min-height: 52px; min-width: 0; border: 1px solid #8F8880; border-radius: 8px; padding: 12px 16px; color: #1B1B1B; background: #FDF7F0; transition: background-color 140ms ease, border-color 140ms ease; }
input::placeholder { color: #6B635A; opacity: 1; }
input:hover { border-color: #4A4A4A; }
input:focus, .field.has-value input { background: #FFF; }
input[aria-invalid="true"] { border-color: #B3261E; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 76px; }
.password-wrap button { position: absolute; right: 4px; top: 4px; min-width: 64px; min-height: 44px; border: 0; border-radius: 8px; padding: 8px; color: #8A4A1E; background: transparent; font-size: 12px; font-weight: 600; }
.password-wrap button:hover { background: #FFE7D0; }
.hint-slot { position: relative; min-height: 44px; margin-top: 6px; }
.hint, .field-error { font-size: 12px; line-height: 1.5; margin: 0; position: absolute; inset: 0 auto auto 0; max-width: 100%; }
.hint { color: #4A4A4A; opacity: 0; transition: opacity 140ms ease; pointer-events: none; }
.field:focus-within .hint { opacity: 1; }
.field.has-error .hint { opacity: 0; }
.field-error { color: #B3261E; }
.setup-hint { color: #4A4A4A; font-size: 12px; margin: 8px 0 0; }
.primary { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #FC6E20; color: #1B1B1B; border: 1px solid #1B1B1B; border-radius: 8px; box-shadow: 0 3px 0 #1B1B1B; padding: 12px 16px; font-size: 14px; font-weight: 600; margin-top: 12px; transition: background-color 140ms ease, box-shadow 140ms ease; }
.primary:hover { background: #FF8845; box-shadow: 0 4px 0 #1B1B1B; }
.primary:active { box-shadow: none; }
.primary:disabled { background: #FFE7D0; box-shadow: none; cursor: wait; }
.primary svg { width: 20px; height: 20px; stroke-width: 1.75; flex-shrink: 0; }
.secondary { width: 100%; min-height: 48px; border: 1px solid #8F8880; border-radius: 8px; background: #FFF; color: #1B1B1B; font-size: 14px; font-weight: 600; padding: 12px 16px; margin-top: 16px; }
.secondary:hover { background: #FDF7F0; }
.help { border-top: 1px solid #E7E1D9; margin-top: 24px; padding-top: 4px; }
summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: #8A4A1E; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 20px; font-weight: 400; }
details[open] summary::after { content: '\2212'; }
summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.help-content p { font-size: 12px; line-height: 1.6; color: #4A4A4A; margin: 8px 0 0; }
:is(input, button, summary, a):focus-visible { outline: 3px solid #8A4A1E; outline-offset: 4px; }
.account { font-size: 18px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.error { color: #B3261E; background: #FDECEA; padding: 16px; border-radius: 8px; font-size: 14px; margin-top: 24px; }
.error:focus { outline: 2px solid #B3261E; outline-offset: 3px; }
.status { font-size: 14px; color: #4A4A4A; margin-top: 16px; }
.status:empty { display: none; }
footer { width: 100%; max-width: 680px; background: #FDF7F0; border: 1px solid #E7E1D9; border-radius: 12px; padding: 16px 20px; }
footer nav { display: flex; justify-content: center; gap: 8px 20px; flex-wrap: wrap; }
footer a { font-size: 12px; color: #8A4A1E; white-space: nowrap; text-underline-offset: 3px; }
footer .ffe-credit { text-align: center; }
@media (max-width: 520px) {
  .page { padding: 16px; }
  main { padding: 36px 8px 32px; }
  .stack { width: 100%; }
  .brand-header { padding: 16px 24px; min-height: 104px; }
  .content { padding: 24px 24px 20px; }
  .sheet.back { transform: translate(-8px, -6px) rotate(-1.5deg); }
  .sheet.base { transform: translate(8px, 9px) rotate(1deg); }
  .stack[data-focus="identifier"] .sheet.back { transform: translate(-10px, -8px) rotate(-1.8deg); }
  .stack[data-focus="identifier"] .sheet.base { transform: translate(8px, 10px) rotate(1.2deg); }
  .stack[data-focus="password"] .sheet.back { transform: translate(-8px, -7px) rotate(-1.3deg); }
  .stack[data-focus="password"] .sheet.base { transform: translate(10px, 11px) rotate(1.5deg); }
  .hint-slot { min-height: 56px; }
  footer { padding: 16px; }
  footer nav { justify-content: flex-start; gap: 12px 16px; }
}
@keyframes world-enter { from { opacity: .65; transform: scale(1.025); } to { opacity: 1; transform: scale(1); } }
@keyframes logo-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
