/* ============================================================
   REVIZIT — Design System
   Token'lar, reset ve tüm paylaşılan componentler burada.
   ============================================================ */

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

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Renkler */
  --bg:       #12100E;
  --surface:  #1E1A17;
  --border:   #2E2824;
  --text:     #F2EDE6;
  --muted:    #87796E;
  --accent:   #D4956A;
  --accent-h: #E8AF88;
  --success:  #7AAF8E;
  --error:    #C87A7A;

  /* Harcama bantları */
  --band0: #6E9B8A;
  --band1: #7A8F9B;
  --band2: #9B8A6E;
  --band3: #8A6E9B;

  /* Spacing */
  --sp-xs:  6px;
  --sp-sm:  12px;
  --sp-md:  20px;
  --sp-lg:  32px;
  --sp-xl:  48px;

  /* Border radius */
  --r-sm:  12px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-xl:  28px;
  --r-pill: 100px;

  /* Typography */
  --font-body:  'DM Sans', sans-serif;
  --font-serif: 'Cormorant Garamond', serif;
}

/* ── Base ────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.5px;
}
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 44px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 17px;
  border-radius: var(--r-md);
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .3px;
}
.btn-primary {
  background: var(--accent);
  color: #12100E;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-h);
}
.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-secondary {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-reward {
  background: var(--success);
  color: #12100E;
  width: auto;
  padding: 12px 24px;
  margin-top: 14px;
}
.btn-reward:hover { opacity: .9; }
.btn-danger {
  background: var(--error);
  color: #12100E;
}

/* ── Inputs ──────────────────────────────────────────────────── */
input[type=text],
input[type=email],
input[type=password] {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus {
  border-color: var(--accent);
}

input[type=tel] {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 17px;
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--text);
  text-align: center;
  letter-spacing: 3px;
  outline: none;
  transition: border-color .2s;
}
input[type=tel]:focus { border-color: var(--accent); }
input[type=tel]::placeholder { color: var(--muted); letter-spacing: 1px; font-size: 15px; }

/* ── Form field wrapper ───────────────────────────────────────── */
.field { text-align: left; margin-bottom: 16px; }
.field label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Error / success text ─────────────────────────────────────── */
.field-err { font-size: 13px; color: var(--error); margin-top: 10px; display: none; }
.err { font-size: 13px; color: var(--error); margin-top: 12px; display: none; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.topbar-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
}
.topbar-biz { font-size: 13px; color: var(--muted); }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--muted); }

/* ── Toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--accent);
  color: #12100E;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  transition: transform .4s ease;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Alert (kasiyer bildirimleri) ────────────────────────────── */
.alert {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  display: none;
}
.alert-warn  { background: rgba(200,122,122,.12); border: 1px solid rgba(200,122,122,.3); color: var(--error); }
.alert-success { background: rgba(122,175,142,.12); border: 1px solid rgba(122,175,142,.3); color: var(--success); }

/* ── Install banner (customer.html) ──────────────────────────── */
#installBanner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#installBanner span { font-size: 13px; color: var(--muted); }
#installBanner button {
  background: var(--accent);
  color: #12100E;
  border: none;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Install box (visit.html içi) ────────────────────────────── */
.install {
  background: rgba(212,149,106,.08);
  border: 1px solid rgba(212,149,106,.2);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

/* ── State machine (visit / register) ────────────────────────── */
.state { display: none; }
.state.active { display: block; }

/* ── Centered layout ─────────────────────────────────────────── */
.center-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Reward box ──────────────────────────────────────────────── */
.reward-box {
  background: rgba(122,175,142,.1);
  border: 1px solid rgba(122,175,142,.3);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 24px;
  text-align: center;
}
.reward-box strong { display: block; font-size: 18px; margin-bottom: 8px; }
.reward-box p { font-size: 14px; color: var(--muted); }

/* ── Light Theme (sistem tercihine göre) ─────────────────────── */
@media (prefers-color-scheme: light) {
  :root {
    --bg:       #F5F0EB;
    --surface:  #FFFFFF;
    --border:   #DDD5CA;
    --text:     #1A1410;
    --muted:    #6B5D54;
    --accent:   #B86A3A;
    --accent-h: #C97A48;
    --success:  #2A6E45;
    --error:    #A02828;

    --band0: #3A7A68;
    --band1: #3A5F7A;
    --band2: #7A5C3A;
    --band3: #5C3A7A;

    /* Kahve fincanı SVG */
    --cup-body:   #D5C8BC;
    --cup-stroke: #C0AFA2;
  }

  /* Buton metinleri: koyu arka planlar için açık kalmalı */
  .btn-primary { color: #FFFFFF; }
  .btn-reward  { color: #FFFFFF; }
  .btn-danger  { color: #FFFFFF; }

  /* Input arka planı */
  input[type=text],
  input[type=email],
  input[type=password],
  input[type=tel] { background: #FFFFFF; }

  /* Topbar'ı koyu bırak — logo her zaman koyu zeminde daha güçlü görünür */
  .topbar {
    background: #1A1410;
    border-bottom-color: #2E2824;
  }
  .topbar-biz { color: #87796E; }

  /* Alert renkleri daha opak */
  .alert-warn    { background: rgba(160,40,40,.1); }
  .alert-success { background: rgba(42,110,69,.1); }
}

.link-muted {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.link-muted:hover { color: var(--accent); }

/* ── Muted link ──────────────────────────────────────────────── */
.link-muted {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.link-muted:hover { color: var(--accent); }
