@import url("storybook-theme.css");
:root {
  --auth-ink: var(--story-ink);
  --auth-muted: var(--story-muted);
  --auth-leaf: var(--story-purple);
  --auth-hover: var(--story-purple-hover);
  --auth-canvas: var(--story-canvas);
  --auth-line: var(--story-line);
  --auth-soft: var(--story-purple-soft);
  --auth-danger: var(--story-error);
  --auth-focus: var(--story-focus);
  font-family: var(--story-font);
  color: var(--auth-ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--auth-canvas); font-size: 1rem; line-height: 1.6; }
h1, h2, p { margin: 0; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
a { color: var(--auth-leaf); text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--auth-focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.auth-colors { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.auth-colors i { position: absolute; display: block; width: 360px; height: 310px; }
.auth-colors i:nth-child(1) { left: -125px; top: -135px; border-radius: 45% 55% 65% 35%; background: var(--story-pink); }
.auth-colors i:nth-child(2) { right: -140px; top: -100px; border-radius: 45% 55% 40% 60%; background: var(--story-purple-soft); }
.auth-colors i:nth-child(3) { left: -130px; bottom: -150px; border-radius: 55% 45% 35% 65%; background: var(--story-yellow); }
.auth-colors i:nth-child(4) { right: -150px; bottom: -140px; border-radius: 45% 55% 65% 35%; background: var(--story-green); }
.auth-header { padding: 20px 32px; max-width: 1240px; margin: auto; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; color: var(--auth-ink); text-decoration: none; font-family: var(--story-heading-font); font-weight: 750; font-size: 1.4rem; }
.auth-brand span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--story-yellow); font-size: 26px; }
.auth-layout { display: grid; grid-template-columns: minmax(0,440px); justify-content: center; gap: 0; max-width: 600px; margin: 2px auto 48px; padding: 0 28px; }
.auth-picture { text-align: center; display: flex; flex-direction: column; align-items: center; padding: 0 20px 18px; }
.auth-picture img { display: block; width: 270px; max-width: 100%; height: 180px; object-fit: contain; }
.auth-picture h2 { font-size: 1.6rem; line-height: 1.4; margin-top: 0; }
.auth-form { min-width: 0; padding: 28px 32px; border: 0; border-radius: 16px; background: #fff; }
.auth-form h1 { font-size: 1.6rem; line-height: 1.3; text-align: center; }
.auth-roles { display: flex; gap: 4px; padding: 5px; background: var(--auth-soft); border-radius: 14px; margin: 20px 0 22px; }
.auth-roles button { flex: 1; min-height: 50px; background: transparent; color: var(--auth-muted); border: 0; border-radius: 10px; font-weight: 700; cursor: pointer; }
.auth-roles button[aria-pressed="true"] { background: var(--auth-leaf); color: #fff; }
form { display: grid; gap: 17px; }
label { display: block; font-weight: 650; margin-bottom: 6px; }
input { min-width: 0; width: 100%; min-height: 52px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--auth-soft); color: var(--auth-ink); }
input:is(:focus, :focus-visible) { border: 0; outline: 0; box-shadow: none; background: var(--story-field-focus); }
input::placeholder { color: var(--story-placeholder); opacity: 1; }
input[aria-invalid="true"] { box-shadow: none; background: var(--story-pink-soft); }
input:disabled { opacity: .65; cursor: not-allowed; }
.password-field { position: relative; }
.password-field input { padding-right: 70px; }
.password-toggle { position: absolute; right: 4px; top: 4px; min-height: 44px; min-width: 56px; padding: 4px 8px; background: transparent; color: var(--auth-leaf); border: 0; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.field-error { margin-top: 6px; font-size: .9rem; color: var(--auth-danger); }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; border: 0; border-radius: 12px; background: var(--auth-leaf); color: #fff; font-weight: 750; cursor: pointer; margin-top: 3px; }
.auth-submit:hover:not(:disabled) { background: var(--auth-hover); }
.auth-roles button:hover:not(:disabled):not([aria-pressed="true"]), .password-toggle:hover:not(:disabled) { background: var(--story-pink-soft); }
button:disabled { cursor: not-allowed; opacity: .65; }
.auth-status { margin-top: 16px; overflow-wrap: anywhere; color: var(--auth-leaf); }
.auth-status:empty { display: none; }
.auth-status[data-state="error"] { color: var(--auth-danger); }
.auth-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--auth-line); font-size: .9rem; color: var(--auth-muted); }
.auth-footer a, .auth-footer summary { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }
.auth-footer details p { margin-top: 6px; max-width: 28ch; }
.auth-spinner { width: 18px; height: 18px; border: 2px solid #ffffff70; border-top-color: #fff; border-radius: 50%; animation: auth-spin 800ms linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (min-width: 900px) {
  body[data-auth="register"] .auth-layout { margin-top: -8px; }
  body[data-auth="register"] .auth-picture img { height: 140px; width: 210px; }
}
@media (max-width: 600px) {
  .auth-header { padding: 14px 20px; }
  .auth-layout { padding: 0 18px; margin-top: 0; }
  .auth-picture { padding: 0 12px 18px; }
  .auth-picture img { width: 228px; height: 152px; }
  .auth-picture h2 { font-size: 1.45rem; }
  .auth-form { padding: 24px; }
  .auth-colors i { width: 180px; height: 200px; }
  .auth-colors i:nth-child(1) { left: -110px; top: 90px; }
  .auth-colors i:nth-child(2) { right: -115px; top: -50px; }
  .auth-colors i:nth-child(3) { left: -100px; bottom: -110px; }
  .auth-colors i:nth-child(4) { right: -110px; bottom: -80px; }
}
@media (max-width: 360px) {
  .auth-form { padding: 22px 18px; }
  .auth-header { padding-left: 18px; }
  .auth-brand { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
