:root {
  --ink: #18313f;
  --muted: #566e79;
  --blue: #8ecfe0;
  --blue-deep: #397b92;
  --blue-pale: #e4f4f6;
  --paper: #f7f6f1;
  --cream: #fffdf8;
  --line: #d4e5e8;
  --red: #a43745;
  --green: #257457;
  --soft-text: #466777;
  --soft-bg: #f1f8f7;
  --input-bg: #fff;
  --input-line: #c9dde1;
  --placeholder: #839aa3;
  --ink-hover: #28516a;
  --red-bg: #fff2f2;
  --red-line: #ecc3c9;
  --green-bg: #ecf8f1;
  --green-line: #b7dfc9;
  --card-shadow: 0 24px 55px rgba(31, 76, 89, .09);
  --tab-shadow: 0 3px 10px rgba(35, 83, 96, .09);
}

/* Koyu tema: ana sitenin paletiyle aynı. html[data-theme] sayfa başındaki satır içi betikle konur (Açık / Koyu / Sistem seçimi). */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9f2f5;
  --muted: #93a8b1;
  --blue: #2c6a80;
  --blue-deep: #8fd0e2;
  --blue-pale: #1b3340;
  --paper: #0f1a21;
  --cream: #15232c;
  --line: #243944;
  --red: #f08592;
  --green: #5cc79a;
  --soft-text: #b4c8d0;
  --soft-bg: #102029;
  --input-bg: #0f1a21;
  --input-line: #33505e;
  --placeholder: #6f8791;
  --ink-hover: #ffffff;
  --red-bg: #3b1f25;
  --red-line: #6b2f39;
  --green-bg: #15352a;
  --green-line: #2b5d47;
  --card-shadow: 0 24px 55px rgba(0, 0, 0, .4);
  --tab-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .submit-button { color: #0f1a21; }

* { box-sizing: border-box; }
html { font-family: Arial, "Helvetica Neue", sans-serif; font-style: normal; }
body { min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; font-style: normal; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--blue-deep); outline-offset: 3px; }

.auth-shell { width: min(100% - 56px, 1200px); margin-inline: auto; }
.auth-header { height: 78px; background: var(--cream); border-bottom: 1px solid var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; letter-spacing: -.03em; }
.brand strong { font-weight: 800; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--blue); color: var(--ink); font-size: 14px; font-weight: 800; letter-spacing: -.06em; }
.back-link { display: inline-flex; align-items: center; gap: 10px; color: var(--blue-deep); font-size: 14px; font-weight: 700; }
.back-link svg { width: 18px; height: 18px; }
.back-link:hover, .auth-switch a:hover, .field-heading a:hover { text-decoration: underline; }

.auth-main { display: block; width: min(100% - 40px, 530px); padding-top: 40px; padding-bottom: 38px; }
.eyebrow, .card-eyebrow { margin: 0; color: var(--blue-deep); font-size: 12px; font-weight: 800; letter-spacing: .15em; }

.auth-card { align-self: center; border: 1px solid var(--line); border-radius: 24px; background: var(--cream); box-shadow: var(--card-shadow); overflow: hidden; }
.card-content { padding: 28px 36px 32px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 37px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft-bg); }
.auth-tabs a { display: grid; place-items: center; min-height: 42px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }
.auth-tabs a:hover { color: var(--ink); }
.auth-tabs a[aria-current="page"] { background: var(--cream); color: var(--ink); box-shadow: var(--tab-shadow); }
.card-eyebrow { margin-bottom: 12px; }
.card-content :is(h1, h2) { margin: 0 0 9px; font-size: 35px; line-height: 1.1; letter-spacing: -.055em; }
.card-content :is(h1, h2) + form, .card-content :is(h1, h2) + .form-message, .card-content :is(h1, h2) + .submit-button { margin-top: 22px; }
.card-subtitle { margin: 0 0 29px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.field input { display: block; width: 100%; height: 52px; padding: 0 15px; border: 1px solid var(--input-line); border-radius: 10px; outline: 0; background: var(--input-bg); color: var(--ink); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: var(--placeholder); }
.field input:focus { border-color: var(--blue-deep); box-shadow: 0 0 0 3px var(--blue-pale); }
.field small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-heading a { margin-bottom: 8px; color: var(--blue-deep); font-size: 13px; font-weight: 700; }
.password-field { position: relative; }
.password-field input { padding-right: 56px; }
.password-toggle { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--blue-pale); color: var(--ink); }
.password-toggle svg { width: 20px; height: 20px; }
.submit-button { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; min-height: 54px; margin-top: 24px; border: 0; border-radius: 10px; background: var(--ink); color: var(--cream); font-size: 15px; font-weight: 800; transition: background .15s, transform .15s; }
.submit-button:hover { background: var(--ink-hover); transform: translateY(-1px); }
.submit-button:disabled { opacity: .65; cursor: wait; transform: none; }
.submit-button svg { width: 18px; height: 18px; }
.auth-switch { margin: 27px 0 0; padding-top: 21px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 14px; }
.auth-switch a { color: var(--blue-deep); font-weight: 800; }
.form-message { margin-bottom: 20px; padding: 12px 14px; border: 1px solid var(--red-line); border-radius: 9px; background: var(--red-bg); color: var(--red); font-size: 14px; line-height: 1.4; }
.form-message[hidden] { display: none; }
.form-message.success { border-color: var(--green-line); background: var(--green-bg); color: var(--green); }
.auth-footer { padding: 0 16px 25px; color: var(--muted); text-align: center; font-size: 12px; }

body[data-auth-mode="register"] .auth-tabs { margin-bottom: 25px; }
body[data-auth-mode="register"] .card-content { padding-top: 24px; padding-bottom: 25px; }
body[data-auth-mode="register"] .card-subtitle { margin-bottom: 19px; }
body[data-auth-mode="register"] .field { margin-bottom: 12px; }
body[data-auth-mode="register"] .field input { height: 47px; }
body[data-auth-mode="register"] .field small { margin-top: 5px; }
body[data-auth-mode="register"] .password-toggle { top: 2px; right: 3px; }
body[data-auth-mode="register"] .submit-button { min-height: 49px; margin-top: 17px; }
body[data-auth-mode="register"] .auth-switch { margin-top: 18px; padding-top: 16px; }

@media (max-width: 540px) {
  .auth-shell { width: min(100% - 28px, 1200px); }
  .auth-header { height: 66px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 36px; height: 36px; }
  .back-link { font-size: 0; gap: 0; }
  .back-link svg { width: 22px; height: 22px; }
  .auth-main { padding-top: 20px; padding-bottom: 24px; }
  .auth-card { border-radius: 18px; }
  .card-content { padding: 21px 22px 27px; }
  .auth-tabs { margin-bottom: 29px; }
  .card-content :is(h1, h2) { font-size: 31px; }
  .card-subtitle { font-size: 14px; }
  .field input { height: 50px; }
  .auth-switch { line-height: 1.6; }
  body[data-auth-mode="register"] .card-content { padding-inline: 22px; }
}

/* Mobil iyileştirmeler: iOS yakınlaştırma yok, dokunma alanı 44px, 320px'te sığar */
@media (max-width: 540px) {
  .field input { font-size: 16px; }
  .back-link { min-width: 44px; min-height: 44px; justify-content: center; }
  .forgot-link, .field-heading a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; }
  .auth-switch a { display: inline-block; padding: 10px 2px; }
  .auth-tabs a { min-height: 44px; }
  .field small { font-size: 12px; }
  .auth-footer { padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 360px) {
  .auth-shell { width: calc(100% - 20px); }
  .card-content { padding-inline: 16px; }
  .card-content :is(h1, h2) { font-size: 27px; }
}

/* Logo: başlık, giriş ve hata sayfalarında aynı işaret */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand::before { content: ""; flex: none; width: 30px; height: 30px; background: url(/files/logo.svg) center / contain no-repeat; }
