/* Abutic sign-in and sign-up (login.php, signup.php): one centered card, blue accent */

:root {
  --au-bg: #f5f7fb;
  --au-surface: #ffffff;
  --au-surface-2: #f6f7fb;
  --au-line: rgba(15, 18, 34, .09);
  --au-line-strong: rgba(15, 18, 34, .16);
  --au-text: #0f1222;
  --au-text-2: #4a5068;
  --au-text-3: #80869c;
  --au-accent: #2563eb;
  --au-accent-2: #1d4ed8;
  --au-accent-3: #06b6d4;
  --au-ok: #0d9f6e;
  --au-ok-bg: #ecfdf5;
  --au-err: #d93a4a;
  --au-err-bg: #fef2f3;
  --au-info: #2f6fde;
  --au-info-bg: #eff5ff;
  --au-shadow: 0 1px 2px rgba(15, 18, 34, .05), 0 24px 60px -28px rgba(15, 18, 34, .3);
  --au-ring: 0 0 0 4px rgba(37, 99, 235, .16);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.au {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--au-bg);
  color: var(--au-text);
  font: 400 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.au a { color: var(--au-accent); text-decoration: none; font-weight: 600; }
.au a:hover { text-decoration: underline; text-underline-offset: 3px; }
.au button { font: inherit; }
.au :focus-visible { outline: none; box-shadow: var(--au-ring); }
.hidden, .au [hidden] { display: none !important; }

/* ------------------------------------------------------------ shell */
.au-shell { min-height: 100vh; min-height: 100dvh; }

/* ------------------------------------------------------------ form panel */
.au-panel { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; padding: 22px clamp(20px, 4vw, 40px) 28px; }
.au-panel__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.au-back { display: inline-flex; align-items: center; gap: 8px; color: var(--au-text-2) !important; font-size: 14px; font-weight: 500 !important; }
.au-back:hover { color: var(--au-text) !important; text-decoration: none !important; }
.au-back i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--au-line); background: var(--au-surface); font-size: 13px; }

.au-body { flex: 1; display: grid; place-items: center; padding: 20px 0 48px; }
.au-card {
  width: 100%; max-width: 440px; padding: 40px 40px 36px; border-radius: 24px;
  background: var(--au-surface); border: 1px solid var(--au-line);
  box-shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 24px 56px -32px rgba(15, 18, 34, .22);
  animation: au-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
.au-logo { display: block; width: 48px; height: 48px; margin-bottom: 20px; padding: 7px; border-radius: 16px; background: var(--au-surface); border: 1px solid var(--au-line); box-shadow: var(--au-shadow); }
.au-card h1 { margin: 0; font: 800 28px/1.15 "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: -.03em; }
.au-sub { margin: 6px 0 24px; color: var(--au-text-2); font-size: 15px; }
.au-note { margin: -14px 0 20px; color: var(--au-text-3); font-size: 13px; overflow-wrap: anywhere; }

.au-field { margin-bottom: 16px; }
.au-field > label, .au-field__label { display: block; margin-bottom: 7px; color: var(--au-text-2); font-size: 13px; font-weight: 600; }
.au-input { position: relative; display: flex; align-items: center; }
.au-input > .au-input__icon { position: absolute; left: 15px; color: var(--au-text-3); font-size: 15px; pointer-events: none; transition: color .18s; }
.au-input input {
  width: 100%; height: 54px; padding: 0 16px 0 44px;
  border-radius: 15px; border: 1.5px solid var(--au-line-strong); background: var(--au-surface);
  color: var(--au-text); font: 500 16px/1 Inter, system-ui, sans-serif;
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none; appearance: none;
}
.au-input input::placeholder { color: var(--au-text-3); font-weight: 400; }
.au-input input:hover { border-color: color-mix(in srgb, var(--au-accent) 35%, var(--au-line-strong)); }
.au-input input:focus { outline: none; border-color: var(--au-accent); box-shadow: var(--au-ring); }
.au-input:focus-within > .au-input__icon { color: var(--au-accent); }
.au-input input[readonly] { background: var(--au-surface-2); }
.au-input--pw input { padding-right: 52px; }
.au-input .pw-eye {
  position: absolute; right: 6px; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 11px; color: var(--au-text-3); cursor: pointer; transition: color .18s, background .18s;
}
.au-input .pw-eye:hover, .au-input .pw-eye.active { color: var(--au-text); background: var(--au-surface-2); }
.au-input--code input { padding-left: 44px; letter-spacing: .4em; font-variant-numeric: tabular-nums; font-weight: 700; }
.au-input input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--au-surface) inset; -webkit-text-fill-color: var(--au-text); }

.au-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; font-size: 14px; }
.au-check { display: inline-flex; align-items: center; gap: 10px; color: var(--au-text-2); cursor: pointer; user-select: none; }
.au-check input { position: absolute; opacity: 0; pointer-events: none; }
.au-check span {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px;
  border: 1.5px solid var(--au-line-strong); background: var(--au-surface); transition: background .15s, border-color .15s;
}
.au-check span::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s; }
.au-check input:checked + span { background: var(--au-accent); border-color: var(--au-accent); }
.au-check input:checked + span::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.au-check input:focus-visible + span { box-shadow: var(--au-ring); }

.au-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; padding: 0 20px; border: 0; border-radius: 15px; cursor: pointer;
  font-size: 16px; font-weight: 700; letter-spacing: -.005em;
  transition: transform .15s, box-shadow .2s, filter .2s, opacity .2s;
}
.au-btn:active:not(:disabled) { transform: scale(.985); }
.au-btn:disabled { cursor: not-allowed; opacity: .6; }
.au-btn--primary {
  color: #fff; background: var(--au-accent);
  box-shadow: 0 8px 20px -12px rgba(37, 99, 235, .7);
}
.au-btn--primary:hover:not(:disabled) { background: var(--au-accent-2); }
.au-btn--primary::after { content: "\2192"; font-weight: 600; transition: transform .2s; }
.au-btn--primary:hover::after { transform: translateX(3px); }
.au-btn--primary:disabled::after { content: none; }
.au-btn--social { color: var(--au-text); background: var(--au-surface); border: 1.5px solid var(--au-line-strong); font-weight: 600; font-size: 15px; }
.au-btn--social:hover:not(:disabled) { background: var(--au-surface-2); text-decoration: none; }
.au-btn--social svg { width: 20px; height: 20px; }
a.au-btn { color: var(--au-text); }
a.au-btn:hover { text-decoration: none; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: au-spin .7s linear infinite; }
#btn:has(.spinner:not(.hidden))::after { content: none; }

.au-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--au-text-3); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.au-divider::before, .au-divider::after { content: ""; flex: 1; height: 1px; background: var(--au-line); }

.au-switch { margin: 26px 0 0; color: var(--au-text-2); font-size: 14.5px; text-align: center; }
.au-legal { margin: 18px 0 0; color: var(--au-text-3); font-size: 12.5px; text-align: center; }
.au-legal a { color: var(--au-text-2); font-weight: 500; }

/* Messages */
.alert {
  display: block; margin: 0 0 18px; padding: 12px 14px 12px 42px; position: relative;
  border-radius: 14px; font-size: 14px; line-height: 1.45;
  color: var(--au-err); background: var(--au-err-bg); border: 1px solid color-mix(in srgb, var(--au-err) 22%, transparent);
  animation: au-shake .4s both;
}
.alert::before { content: "\f06a"; position: absolute; left: 14px; top: 12px; font: 900 16px/1.3 "Font Awesome 6 Free"; }
#msg.alert { display: none; }
.alert.alert-ok { color: var(--au-ok); background: var(--au-ok-bg); border-color: color-mix(in srgb, var(--au-ok) 22%, transparent); animation: au-rise .3s both; }
.alert.alert-ok::before { content: "\f058"; }
.alert.alert-info, .alert.alert-provision { color: var(--au-info); background: var(--au-info-bg); border-color: color-mix(in srgb, var(--au-info) 22%, transparent); animation: au-rise .3s both; }
.alert.alert-info::before, .alert.alert-provision::before { content: "\f3ed"; }
.alert-provision a { color: inherit; text-decoration: underline; }

.turnstile-wrapper { display: flex; justify-content: center; margin: 4px 0 16px; min-height: 0; }
.turnstile-wrapper:empty { display: none; }

.au-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--au-text); color: var(--au-bg); font-size: 14px; font-weight: 600;
  box-shadow: var(--au-shadow); animation: au-rise .3s both;
}

/* ------------------------------------------------------------ signup steps */
.ab-signup-progress { display: flex; gap: 6px; margin-bottom: 18px; }
.ab-signup-progress__dot { height: 5px; width: 28px; border-radius: 99px; background: var(--au-line-strong); transition: width .3s, background .3s; }
.ab-signup-progress__dot.is-active { width: 44px; background: var(--au-accent); }
.ab-signup-progress__dot.is-done { width: 28px; background: var(--au-accent); }
.au-steplabel { margin-left: 8px; color: var(--au-text-3); font-size: 12px; font-weight: 600; }
.ab-signup-step--password { display: none; }
.ab-signup-form.is-step-2 .ab-signup-step--email { display: none; }
.ab-signup-form.is-step-2 .ab-signup-step--password { display: block; animation: au-slide .35s cubic-bezier(.2, .8, .2, 1) both; }
.ab-signup-form:not(.is-step-2) .ab-signup-step--email { animation: au-slide-back .35s cubic-bezier(.2, .8, .2, 1) both; }
.ab-signup-step-error { margin: 12px 0 0; color: var(--au-err); font-size: 13.5px; font-weight: 500; }
.ab-signup-email-chip {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 8px 8px 8px 12px;
  border-radius: 15px; background: var(--au-surface-2); border: 1px solid var(--au-line);
}
.ab-signup-email-chip::before {
  content: "\f0e0"; display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px;
  color: #fff; background: linear-gradient(135deg, var(--au-accent), var(--au-accent-3)); font: 900 13px/1 "Font Awesome 6 Free";
}
#emailChipText { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14.5px; }
.ab-signup-email-change {
  flex: none; padding: 8px 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--au-surface); color: var(--au-text-2); font-size: 13px; font-weight: 600; box-shadow: 0 1px 2px rgba(15, 18, 34, .08);
}
.ab-signup-email-change:hover { color: var(--au-text); }
.strength { height: 5px; margin-top: 10px; border-radius: 99px; background: var(--au-surface-2); overflow: hidden; }
.strength-bar { width: 0; height: 100%; border-radius: inherit; transition: width .3s, background .3s; }
.strength-text { min-height: 18px; margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.ab-signup-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------ motion */
@keyframes au-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes au-slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes au-slide-back { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes au-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes au-spin { to { transform: rotate(360deg); } }

/* Desktop: wider card over a soft blue glow and a faint grid that fades out around it */
@media (min-width: 901px) {
  .au-panel { isolation: isolate; overflow: hidden; }
  .au-panel::before, .au-panel::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
  .au-panel::before {
    left: 50%; top: 50%; width: 1100px; height: 760px; transform: translate(-50%, -52%);
    background:
      radial-gradient(closest-side at 38% 40%, rgba(37, 99, 235, .24), transparent),
      radial-gradient(closest-side at 64% 62%, rgba(6, 182, 212, .2), transparent);
    filter: blur(10px);
  }
  .au-panel::after {
    inset: 0;
    background-image: linear-gradient(rgba(15, 18, 34, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 18, 34, .055) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 620px 460px at 50% 50%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 620px 460px at 50% 50%, #000 30%, transparent 100%);
  }
  .au-card { position: relative; max-width: 480px; padding: 44px 48px 40px; box-shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 30px 70px -36px rgba(30, 64, 175, .35); }
  .au-card::before { content: ""; position: absolute; left: 48px; right: 48px; top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--au-accent), var(--au-accent-3), transparent); }
}

/* ------------------------------------------------------------ responsive */
/* Phones: no card chrome, just the form on white. */
@media (max-width: 900px) {
  body.au { background: var(--au-surface); }
  .au-panel { padding: calc(10px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
  .au-panel__top { min-height: 44px; }
  .au-back { margin-left: -10px; }
  .au-back span { display: none; }
  .au-back i { width: 44px; height: 44px; border: 0; background: none; font-size: 17px; color: var(--au-text); }
  .au-body { display: block; padding: 14px 0 0; }
  .au-card { max-width: 440px; margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; animation-name: au-fade; animation-duration: .35s; }
  .au-logo { width: 44px; height: 44px; margin-bottom: 18px; padding: 6px; border-radius: 13px; }
  .au-card h1 { font-size: 26px; }
  .au-input input { background: var(--au-surface-2); border-color: transparent; }
  .au-input input:focus { background: var(--au-surface); }
  .au-btn--primary { box-shadow: none; }
  .au-divider { margin-top: 20px; margin-bottom: 20px; }
  .au-switch { margin-top: 22px; }
  .ab-signup-progress { margin-top: 4px; }
  @keyframes au-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 380px) {
  .au-panel { padding-left: 16px; padding-right: 16px; }
  .au-row { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
