/* E-Market — styles for the Sign up / Log in page (index.html) */

/* ===== Colors (same as index.html) ===== */
:root {
  --main: #0f766e;
  --accent: #e85d75;
  --accent-dark: #d4475f;
  --bg: #f4f6f5;
  --card: #ffffff;
  --field: #f8faf9;
  --line: #e2e8e5;
  --text: #1f2a28;
  --muted: #64748b;
  --error: #dc2626;
  --success: #15803d; --success-bg: #dcfce7;
  --sky: linear-gradient(180deg, #dbeafe 0%, #fdf2f8 55%, #fff7ed 100%);
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
  --radius: 14px;
}
html[data-theme="dark"] {
  --main: #2dd4bf;
  --bg: #0f1514;
  --card: #1a2221;
  --field: #141b1a;
  --line: #2b3533;
  --text: #e5ecea;
  --muted: #94a3b8;
  --error: #f87171;
  --success: #4ade80; --success-bg: #14321f;
  --sky: linear-gradient(180deg, #0b1730 0%, #1e1b3a 60%, #2a1f2e 100%);
  --shadow: 0 10px 30px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }

/* ===== Header with the same shop-street art ===== */
header {
  position: relative;
  height: 220px;
  background: var(--sky);
}
header .art {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 150px;
  pointer-events: none;
}
header .wrap { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 16px 20px; }
.brand { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); }
html[data-theme="dark"] .sun-outer { fill: #475569; }
html[data-theme="dark"] .sun-inner { fill: #e2e8f0; }
html[data-theme="dark"] .clouds { opacity: 0.15; }
html[data-theme="dark"] .art { filter: brightness(0.8); }

/* ===== Login / Sign up box ===== */
main { padding: 0 16px 40px; }
.auth {
  position: relative;
  max-width: 420px;
  margin: -40px auto 0;           /* box slightly overlaps the header art */
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth h1 { font-size: 1.45rem; font-weight: 700; }
.auth .sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 20px; }

/* Tabs: Log in | Sign up */
.tabs {
  display: flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.tab {
  flex: 1;
  padding: 9px 0;
  border: none; border-radius: 999px;
  background: transparent;
  font-weight: 600; font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab.on { background: var(--accent); color: #fff; }

/* Forms */
form { display: none; flex-direction: column; gap: 14px; }
form.on { display: flex; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; }
.input {
  display: flex; align-items: center;
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s;
}
.input:focus-within { border-color: var(--accent); }
.input.bad { border-color: var(--error); }
.input input {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  border: none; outline: none; background: transparent;
  font-size: 1rem;
}
.input input::placeholder { color: var(--muted); }
/* show / hide password button */
.eye {
  border: none; background: none; cursor: pointer;
  padding: 0 12px; color: var(--muted);
  display: flex; align-items: center;
}
.eye svg { width: 20px; height: 20px; }
.err { color: var(--error); font-size: 0.8rem; min-height: 0; display: none; }
.err.show { display: block; }
.hint { color: var(--muted); font-size: 0.78rem; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.88rem; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.link { color: var(--accent); font-weight: 600; text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; }
.link:hover { text-decoration: underline; }

.submit {
  margin-top: 4px;
  padding: 13px;
  border: none; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.submit:hover { background: var(--accent-dark); }
.submit:active { transform: scale(0.98); }
.switch-text { text-align: center; font-size: 0.9rem; color: var(--muted); }

/* Message box (success / info) */
.msg {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--success-bg); color: var(--success);
  font-size: 0.9rem; font-weight: 600;
  margin-bottom: 14px;
}
.msg.show { display: block; }
.msg.error { background: rgba(220, 38, 38, 0.12); color: var(--error); }   /* red message for problems */
.submit:disabled { cursor: wait; }

.note { text-align: center; margin-top: 18px; font-size: 0.85rem; color: var(--muted); }

/* ===== Phone screens ===== */
@media (max-width: 600px) {
  header { height: 180px; }
  header .art { height: 115px; }
  header .wrap { padding: 12px 14px; }
  .brand { font-size: 1.35rem; }
  main { padding: 0 12px 30px; }
  .auth { padding: 22px 18px; margin-top: -30px; }
  .auth h1 { font-size: 1.3rem; }
}

/* ===== Buyer / Seller choice ===== */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.role strong { font-size: 1rem; }
.role span { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.role:hover { border-color: var(--accent); }
.role.on { border-color: var(--accent); background: rgba(232, 93, 117, 0.08); }
.role.on strong { color: var(--accent); }

/* Seller-only fields: hidden until "Seller" is chosen */
.seller-fields { display: none; flex-direction: column; gap: 14px; }
.seller-fields.show { display: flex; }

/* ===== Verification code ===== */
.verify-text { font-size: 0.92rem; color: var(--muted); }
.verify-text strong { color: var(--text); word-break: break-all; }
.input input.otp {
  text-align: center;
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
}
.link:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* Page stays hidden while we check if the person is already logged in (see js/index-head.js) */
html.auth-checking body { visibility: hidden; }
