/* İşletme giriş — kök /isletme-giris.html (vitrin-panel bağımlılığı yok) */
:root {
  --font-sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #ffffff;
  --bg-soft: #f4fbfa;
  --turquoise: #14b8a6;
  --turquoise-deep: #0d9488;
  --turquoise-dark: #0f766e;
  --turquoise-bright: #5eead4;
  --turquoise-glow: rgba(20, 184, 166, 0.45);
  --text: #1a2e2c;
  --text-muted: #5c6d6a;
  --border: rgba(20, 184, 166, 0.22);
  --logo-h: clamp(48px, 12vmin, 72px);
  --page-pad-x: max(1rem, env(safe-area-inset-left, 0px));
  --page-pad-r: max(1rem, env(safe-area-inset-right, 0px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  display: none;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--turquoise) 0%, var(--turquoise-deep) 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 8px 28px var(--turquoise-glow);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--turquoise);
  color: var(--turquoise-deep);
  background: #fff;
}

body.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--bg-soft) 0%, var(--bg) 45%, var(--bg-soft) 100%);
}

.auth-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: max(0.85rem, env(safe-area-inset-top, 0px)) var(--page-pad-r) 0.5rem var(--page-pad-x);
}

.auth-back-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--turquoise-deep);
  text-decoration: none;
}

.auth-back-link:hover {
  text-decoration: underline;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem) var(--page-pad-r) max(1.5rem, env(safe-area-inset-bottom, 0px)) var(--page-pad-x);
  width: 100%;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: clamp(1.35rem, 3.5vw, 1.85rem) clamp(1.25rem, 3vw, 1.65rem);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75) inset, 0 16px 48px rgba(20, 184, 166, 0.12);
}

/* login.html — işletme + müşteri yan yana; sekme ile odak değişir */
.auth-card--split {
  max-width: min(900px, 100%);
  padding: clamp(1.15rem, 2.8vw, 1.5rem) clamp(1rem, 2.2vw, 1.35rem) clamp(1.25rem, 2.8vw, 1.6rem);
}

.auth-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-split-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: box-shadow 0.28s ease, background 0.28s ease;
}

@media (min-width: 721px) {
  .auth-split-col {
    min-height: min(58vh, 520px);
  }
}

.auth-split-col--customer {
  border-left: 1px solid var(--border);
}

.auth-split-col.is-focused {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.28), inset 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Gövde: form alanı */
.auth-split-stack {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.auth-split-inner {
  position: relative;
  padding: clamp(0.95rem, 2.2vw, 1.2rem) clamp(0.85rem, 2vw, 1.05rem) clamp(1.05rem, 2vw, 1.2rem);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.auth-card--split .auth-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0.85rem;
}

.auth-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 0 0 auto;
}

.auth-form-inline-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 380px) {
  .auth-form-inline-2 {
    grid-template-columns: 1fr;
  }
}

.auth-label-muted {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.86em;
}

.auth-form-tail {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.auth-form-tail .auth-register-btn {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.15rem;
  text-align: center;
  font-weight: 700;
}


.auth-row--balance {
  min-height: 2.75rem;
  margin: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-split-tab {
  flex-shrink: 0;
  width: 100%;
  border: 0;
  cursor: pointer;
  padding: 0.62rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(244, 251, 250, 0.95);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, color 0.2s;
}

.auth-split-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--turquoise) 0%, var(--turquoise-deep) 100%);
  border-bottom-color: transparent;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.2);
}

.auth-card--split .auth-title {
  font-size: clamp(1.12rem, 2.8vw, 1.38rem);
}

.auth-card--split .auth-lead {
  font-size: 0.8rem;
  line-height: 1.55;
  margin: 0 0 0.85rem;
}

@media (max-width: 720px) {
  .auth-card.auth-card--split {
    overflow: visible;
  }

  .auth-split-grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    min-height: 0;
  }

  .auth-split-grid[data-stack-focus="customer"] #customerPanel,
  .auth-split-grid[data-stack-focus="business"] #businessPanel {
    order: 0;
  }

  .auth-split-grid[data-stack-focus="customer"] #businessPanel,
  .auth-split-grid[data-stack-focus="business"] #customerPanel {
    order: 1;
  }

  .auth-split-col--customer {
    border-left: 0;
    border-top: 0;
  }

  .auth-split-col--visual-top {
    border-top: 0 !important;
  }

  .auth-split-col--visual-bottom {
    border-top: 1px solid var(--border);
  }
}

@media (min-width: 721px) {
  #businessPanel,
  #customerPanel {
    order: 0;
  }

  .auth-split-col--visual-top,
  .auth-split-col--visual-bottom {
    border-top: unset !important;
  }
}

/* Müşteri deep-link (?customer=1): tek kart — işletme sütunu ve üst sekme gizli (head script + login-dual) */
html.auth-page--customer-only .auth-card--split,
body.auth-page--customer-only .auth-card--split {
  max-width: 420px;
}

html.auth-page--customer-only .auth-split-grid,
body.auth-page--customer-only .auth-split-grid {
  grid-template-columns: 1fr;
}

html.auth-page--customer-only #businessPanel,
body.auth-page--customer-only #businessPanel {
  display: none !important;
}

html.auth-page--customer-only #selectCustomer,
body.auth-page--customer-only #selectCustomer {
  display: none !important;
}

html.auth-page--customer-only #customerPanel.auth-split-col--customer,
body.auth-page--customer-only #customerPanel.auth-split-col--customer {
  border-left: 0;
  border-top: 0;
}

html.auth-page--customer-only #customerPanel.is-focused,
body.auth-page--customer-only #customerPanel.is-focused {
  border-radius: 18px;
}

.auth-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--turquoise-deep);
}

.auth-title {
  margin: 0 0 0.65rem;
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--turquoise-dark);
}

.auth-lead {
  margin: 0 0 1.35rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-input {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.auth-input:focus {
  outline: none;
  border-color: var(--turquoise);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--turquoise-deep);
  text-decoration: none;
}

.auth-submit {
  width: 100%;
  margin-top: 0.35rem;
  min-height: 48px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.15s ease;
}
.auth-submit:disabled:not(.is-loading):not(.is-success):not(.is-error) {
  opacity: 0.55;
  cursor: not-allowed;
}
.auth-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-card--split .auth-form-tail .auth-submit {
  margin-top: 0;
}

.auth-card--split .auth-hint {
  text-align: left;
}

.auth-hint {
  margin: -0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(92, 109, 106, 0.85);
  text-align: center;
}

.auth-hint--tight {
  margin-top: 0.35rem;
  margin-bottom: 0;
  text-align: left;
}

.auth-success-banner {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 600;
  animation: authFadeIn 0.35s ease;
}

.auth-success-banner:empty {
  display: none !important;
}

.auth-resend-verify {
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.auth-resend-verify summary {
  cursor: pointer;
  color: var(--turquoise-deep);
  font-weight: 600;
}

.auth-resend-verify-body {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-resend-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}

.auth-error {
  margin: 0;
  min-height: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #be123c;
  padding: 0;
  border-radius: var(--radius-md, 12px);
  transition: all 0.3s ease;
}
.auth-error:not(:empty) {
  min-height: 1.25rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
  background: rgba(190, 18, 60, 0.08);
  border: 1px solid rgba(190, 18, 60, 0.25);
  animation: authShake 0.4s ease-in-out, authFadeIn 0.3s ease;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}
@keyframes authPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes authSuccessPop {
  0% { transform: scale(0.95); opacity: 0; }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

.auth-submit.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.auth-submit.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
}

.auth-submit.is-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset, 0 8px 28px rgba(5,150,105,0.35) !important;
  pointer-events: none;
  animation: authSuccessPop 0.35s ease;
}
.auth-submit.is-success::after {
  content: "✓";
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

.auth-submit.is-error {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset, 0 8px 28px rgba(225,29,72,0.3) !important;
  animation: authShake 0.4s ease-in-out;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.auth-foot {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-foot a {
  color: var(--turquoise-deep);
  font-weight: 600;
  text-decoration: none;
}

/* Eski sekme şeridi — login artık auth-split-tab kullanıyor */
.auth-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
}
.auth-mode-tab {
  flex: 1;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  transition: background 0.2s, color 0.2s;
}
.auth-mode-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--turquoise) 0%, var(--turquoise-deep) 100%);
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.25);
}
button.auth-linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--turquoise-deep);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.auth-linkish:hover {
  color: var(--turquoise-dark);
}

/* Google ile giriş */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(100, 116, 139, 0.3);
  background: #fff;
  color: #333;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}
.auth-google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-social-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.auth-social-mount {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.auth-apple-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.85);
  background: #000;
  color: #fff;
  font-weight: 600;
}
.auth-apple-btn:hover {
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Telefon ile giriş (phone auth) */
#customerPhoneAuthRow {
  margin-top: 0.25rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md, 12px);
  border: 1px dashed rgba(100, 116, 139, 0.3);
  background: rgba(100, 116, 139, 0.04);
}
#customerPhoneLoginBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#customerPhoneAuthHint {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

/* Panel 2FA */
.panel-2fa-section {
  margin-top: 1.25rem;
  animation: fadeInUp 0.35s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel-2fa-header {
  text-align: center;
  margin-bottom: 1rem;
}
.panel-2fa-icon {
  font-size: 2.2rem;
  margin-bottom: 0.35rem;
}
.panel-2fa-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading, #0f172a);
  margin: 0 0 0.3rem;
}
.panel-2fa-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}
.panel-2fa-code-input {
  text-align: center;
  letter-spacing: 0.45em;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.panel-2fa-resend {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.45rem;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: var(--accent, #14b8a6);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.panel-2fa-resend:hover { color: var(--accent-hover, #0d9488); }
.panel-2fa-cancel {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.45rem;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  cursor: pointer;
}
.panel-2fa-cancel:hover { color: var(--text-heading, #0f172a); }
#panel2faRecaptcha {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}
