/* ==========================================================================
   RandevuSoft • Login Ekranı (Profesyonel Tasarım)
   index/index.css ile aynı tasarım sistemini paylaşır
   ========================================================================== */

:root {
  --green: #14584a;
  --green-dark: #0b3b30;
  --green-light: #2b8a6f;
  --green-mint: #7fc9ad;
  --soft: #eaf4ef;
  --soft-dark: #d5e9df;
  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;
  --orange: #b77528;
  --orange-soft: #fcf4e8;
  --bg: #f6faf8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --ink: #15262a;
  --ink-muted: #55686c;
  --muted: #819398;
  --line: #e2eae8;
  --line-strong: #c9d7d4;
  --shadow-sm: 0 2px 10px rgba(11, 59, 48, 0.05);
  --shadow-md: 0 14px 40px rgba(11, 59, 48, 0.09);
  --shadow-lg: 0 28px 70px rgba(11, 59, 48, 0.14);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  --grad-brand: linear-gradient(135deg, #0b3b30 0%, #14584a 48%, #2b8a6f 100%);
}

body.dark {
  --bg: #0c1416;
  --bg-elev: #121e20;
  --surface: #141f22;
  --surface-raised: #1b2a2d;
  --ink: #eef5f3;
  --ink-muted: #a7b8b5;
  --muted: #7a8d8a;
  --line: #24363a;
  --line-strong: #33494e;
  --soft: #172a26;
  --soft-dark: #1f3833;
  --green: #7fc9ad;
  --green-light: #9dd8c1;
  --orange: #e5b36e;
  --orange-soft: #2c2416;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);
  --grad-brand: linear-gradient(135deg, #0b3b30 0%, #14584a 55%, #2b8a6f 100%);
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }

h1, h2, h3, .brand { font-family: 'Manrope', 'DM Sans', sans-serif; letter-spacing: -0.02em; font-weight: 750; line-height: 1.2; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--green-light);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] { display: none !important; }

/* ==========================================================================
   Layout
   ========================================================================== */

.login-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

/* ==========================================================================
   Story (sol panel)
   ========================================================================== */

.story {
  position: relative;
  overflow: hidden;
  background: var(--grad-brand);
  color: #fff;
  padding: 42px 52px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.story::before {
  content: "";
  position: absolute;
  top: -12%;
  right: -12%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 201, 173, 0.42), transparent 65%);
}
.story::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 75% 60% at 30% 25%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 30% 25%, #000, transparent 75%);
  pointer-events: none;
}
.story > * { position: relative; z-index: 1; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 800; color: #fff; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark img { width: 34px; height: 34px; object-fit: contain; }
.brand b { color: var(--green-mint); font-weight: 800; }

.story-copy { margin-top: auto; max-width: 540px; }
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 18px;
}
.story-copy h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 14px; }
.story-copy h2 em { font-style: normal; color: var(--green-mint); }
.story-copy > p { color: rgba(255, 255, 255, 0.82); font-size: 1rem; max-width: 470px; }

.story-stats { display: flex; align-items: center; gap: 22px; margin: 24px 0 4px; }
.story-stats > div { display: flex; flex-direction: column; }
.story-stats strong { font-family: 'Manrope', sans-serif; font-size: 1.55rem; font-weight: 800; color: #fff; line-height: 1.1; }
.story-stats .stat-of { font-size: 0.95rem; color: var(--green-mint); font-weight: 700; }
.story-stats span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.72); }
.story-stats .stat-divider { width: 1px; height: 34px; background: rgba(255, 255, 255, 0.22); }

.workspace-art {
  margin: 24px 0 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.art-header { display: flex; align-items: center; gap: 7px; padding: 11px 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.art-header .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.art-header .dot:first-child { background: #ef8b8b; }
.art-header .dot:nth-child(2) { background: #f2cf7e; }
.art-header .dot:nth-child(3) { background: var(--green-mint); }
.art-header b { margin-left: auto; font-size: 0.74rem; letter-spacing: 0.04em; opacity: 0.85; font-weight: 600; }
.art-body { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 14px; }
.art-sidebar { display: flex; flex-direction: column; gap: 9px; padding-top: 4px; }
.art-sidebar i { height: 9px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); }
.art-sidebar i:first-child { background: var(--green-mint); }
.art-calendar { display: flex; flex-direction: column; gap: 12px; }
.art-heading { height: 14px; width: 42%; border-radius: 5px; background: rgba(255, 255, 255, 0.3); }
.calendar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.calendar-grid i { height: 34px; border-radius: 8px; background: rgba(255, 255, 255, 0.14); }
.calendar-grid i:nth-child(2) { background: var(--green-mint); }
.calendar-grid i:nth-child(5) { background: rgba(255, 255, 255, 0.28); }

.story-features { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.story-features li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.story-features .icon { width: 16px; height: 16px; color: var(--green-mint); }

.story > small { opacity: 0.68; font-size: 0.8rem; }

/* ==========================================================================
   Auth (sağ panel)
   ========================================================================== */

.auth {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 46px 30px;
  background: var(--bg);
  overflow: hidden;
}
.auth::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 201, 173, 0.28), transparent 68%);
  pointer-events: none;
}
.auth::after {
  content: "";
  position: absolute;
  bottom: -180px;
  left: -160px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 138, 111, 0.16), transparent 68%);
  pointer-events: none;
}
.auth > * { position: relative; z-index: 1; }

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  color: var(--ink-muted);
  font-size: 0.9rem;
  transition: var(--transition);
}
.back-link:hover { color: var(--green); }
.back-link .icon { width: 16px; height: 16px; transition: transform 0.2s ease; }
.back-link:hover .icon { transform: translateX(-3px); }
.auth-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--soft);
  border: 1px solid var(--soft-dark);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.auth-card {
  width: 100%;
  max-width: 452px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.auth-logo {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  object-fit: contain;
  padding: 7px;
  flex-shrink: 0;
}
.auth-brand strong { display: block; font-family: 'Manrope', sans-serif; font-size: 1.08rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand strong b { color: var(--green); font-weight: 800; }
.auth-brand small { display: block; font-size: 0.78rem; color: var(--muted); }

.auth-card h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.auth-card p { color: var(--ink-muted); font-size: 0.93rem; margin-bottom: 20px; }
.auth-card p b { color: var(--whatsapp-dark); font-weight: 700; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--soft);
  margin-bottom: 20px;
}
.tabs button {
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-muted);
  transition: var(--transition);
}
.tabs button.active { background: var(--surface); color: var(--green); box-shadow: var(--shadow-sm); }

form { display: flex; flex-direction: column; gap: 14px; }
form label { font-size: 0.85rem; font-weight: 650; }
.phone-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; transition: var(--transition); }
.phone-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(43, 138, 111, 0.14); }
.phone-field > span { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; font-weight: 700; color: var(--ink-muted); border-right: 1px solid var(--line); white-space: nowrap; }
.prefix-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; display: inline-block; }
.phone-field input { flex: 1; border: none; background: transparent; padding: 13px 14px; font-size: 0.98rem; min-width: 0; }
.phone-field input:focus { outline: none; }

.channel-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.28);
  font-size: 0.83rem;
  color: var(--ink-muted);
  line-height: 1.45;
}
.channel-note b { color: var(--whatsapp-dark); font-weight: 700; }
.whatsapp-icon { width: 20px; height: 20px; color: var(--whatsapp-dark); flex-shrink: 0; margin-top: 1px; }
.method-icon { width: 20px; height: 20px; color: var(--whatsapp-dark); flex-shrink: 0; margin-top: 1px; }

.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.96rem;
  transition: var(--transition);
}
.primary { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 26px rgba(20, 88, 74, 0.28); }
.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(20, 88, 74, 0.36); }
.primary .icon { width: 17px; height: 17px; transition: transform 0.24s ease; }
.primary:hover .icon { transform: translateX(3px); }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.secondary:hover { border-color: var(--green); color: var(--green); }
.secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.secondary .icon { width: 16px; height: 16px; }
.text-button { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-top: 4px; transition: var(--transition); }
.text-button:hover { color: var(--green); }

.qr-frame { display: grid; place-items: center; padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); margin: 8px 0 16px; }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.qr-placeholder svg { border-radius: 12px; }
.qr-placeholder span { font-size: 0.8rem; color: var(--muted); max-width: 260px; }
#qr-section > p { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 12px; }
#qr-timer { font-family: 'Manrope', sans-serif; font-weight: 600; color: var(--ink-muted); font-size: 0.88rem; margin-bottom: 14px; }
#qr-timer b { color: var(--green); font-weight: 800; }

.secure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}
.secure-row span {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--ink-muted);
  background: var(--soft);
  border: 1px solid var(--soft-dark);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

.otp-fields { display: flex; gap: 9px; justify-content: space-between; margin: 4px 0; }
.otp-digit {
  width: 100%;
  aspect-ratio: 1 / 1.12;
  text-align: center;
  font-family: 'Manrope', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: var(--transition);
}
.otp-digit:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(43, 138, 111, 0.14); }
.code-timer { font-size: 0.85rem; color: var(--muted); margin: 0; }
.code-timer b { color: var(--green); font-weight: 800; }
.code-timer.expired { color: #d64545; font-weight: 600; }
#code-page { display: flex; flex-direction: column; gap: 12px; }
#branch-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.branch-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: var(--transition); }
.branch-option:hover { border-color: var(--green); }
.branch-option:has(input:checked) { border-color: var(--green); background: var(--soft); box-shadow: 0 0 0 3px rgba(43, 138, 111, 0.12); }
.branch-option input { accent-color: var(--green); width: 18px; height: 18px; flex-shrink: 0; }
.branch-option strong { font-size: 0.92rem; font-weight: 700; font-family: 'Manrope', sans-serif; }
.branch-option small { color: var(--muted); font-size: 0.78rem; }

#status { min-height: 20px; font-size: 0.85rem; color: var(--green); font-weight: 600; margin-top: 12px; }
#status.error { color: #d64545; }

.auth-help {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--muted);
}
.auth-help a { color: var(--green); font-weight: 700; transition: var(--transition); }
.auth-help a:hover { text-decoration: underline; }
.auth > footer { text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: 16px; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 130;
  display: none;
  max-width: min(92vw, 460px);
  padding: 15px 22px;
  border-radius: var(--radius-md);
  background: var(--green-dark);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.toast[style*="block"] { animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-height: 860px) {
  .workspace-art, .story-features { display: none; }
  .story-copy { margin-top: 12px; }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .story { padding: 30px 26px; min-height: auto; gap: 18px; }
  .story-copy { margin-top: 6px; }
  .story-stats { margin: 20px 0 0; }
  .auth { padding: 24px 22px; }
  .auth-card { margin: 18px 0; padding: 26px; }
}

@media (max-width: 640px) {
  html { font-size: 14.5px; }
  .auth-card { padding: 22px; border-radius: var(--radius-lg); }
  .auth-card h1 { font-size: 1.5rem; }
  .story { padding: 24px 20px; }
  .otp-fields { gap: 6px; }
  .auth-top-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
