/* ============================================================
   Screen Tax Web Dashboard — Shared Styles
   Colors mirror the Android app:
     Background  #121212
     Surface     #1E1E1E
     Teal        #00BFA5
     Accent      #E64A19
   ============================================================ */

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

html { font-size: 15px; }

body {
  background: #121212;
  color: #E0E0E0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: #00BFA5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth page (login/register) ── */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #1E1E1E;
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

.brand {
  font-size: 26px;
  font-weight: 700;
  color: #00BFA5;
  margin-bottom: 4px;
}
.brand-sub {
  color: #616161;
  font-size: 14px;
  margin-bottom: 28px;
}

.tab-row {
  display: flex;
  border-bottom: 1px solid #2C2C2C;
  margin-bottom: 24px;
}
.tab {
  background: none;
  border: none;
  color: #757575;
  padding: 8px 16px 12px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.tab.active {
  color: #00BFA5;
}
.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: #00BFA5;
}

/* ── Forms ── */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  color: #9E9E9E;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field .hint { font-size: 11px; text-transform: none; letter-spacing: 0; color: #616161; }

.field input {
  width: 100%;
  background: #2C2C2C;
  border: 1px solid #3A3A3A;
  border-radius: 8px;
  color: #E0E0E0;
  padding: 11px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-color: #00BFA5; }

.btn-primary {
  display: block;
  width: 100%;
  background: #00BFA5;
  color: #121212;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
.btn-primary:hover    { background: #00A896; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  background: transparent;
  border: 1px solid #00BFA5;
  color: #00BFA5;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(0,191,165,0.08); }

.btn-danger {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid #E64A19;
  color: #E64A19;
  border-radius: 8px;
  padding: 11px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(230,74,25,0.08); }

.error-msg {
  color: #E64A19;
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}
.success-msg {
  color: #00BFA5;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ── App shell ── */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Nav ── */

nav {
  background: #1E1E1E;
  border-bottom: 1px solid #2C2C2C;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-brand {
  font-size: 16px;
  font-weight: 700;
  color: #00BFA5;
  margin-right: 16px;
}

.nav-logo {
  height: 32px;
  width: auto;
  margin-right: 16px;
  object-fit: contain;
}

/* Login page logo */
.auth-logo-wrap {
  text-align: center;
  margin-bottom: 12px;
}
.auth-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
}

nav a {
  color: #9E9E9E;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.15s;
}
nav a:hover       { color: #E0E0E0; text-decoration: none; }
nav a.active      { color: #00BFA5; background: rgba(0,191,165,0.08); }

/* ── Main content ── */

main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.page-header { margin-bottom: 20px; }
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.page-header-row h2 { margin-bottom: 0; }
.page-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: #F5F5F5;
}
.page-sub {
  color: #757575;
  font-size: 14px;
  margin-top: 4px;
}

/* ── Card ── */

.card {
  background: #1E1E1E;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #757575;
  margin-bottom: 14px;
}

/* ── Total card ── */

.total-card { }
.total-label {
  font-size: 12px;
  color: #757575;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.total-amount {
  font-size: 42px;
  font-weight: 700;
  color: #00BFA5;
  margin-bottom: 12px;
}
.cap-bar-bg {
  background: #2C2C2C;
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}
.cap-bar-fill {
  height: 5px;
  background: #00BFA5;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.cap-bar-fill.near-cap { background: #E64A19; }
.cap-hint {
  font-size: 12px;
  color: #616161;
  margin-top: 7px;
}

/* ── Domain rows ── */

.domain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #2C2C2C;
}
.domain-row:last-child { border-bottom: none; }
.domain-row.untracked .domain-name { color: #424242; }
.domain-name { font-size: 15px; color: #BDBDBD; }
.domain-meta { font-size: 12px; color: #616161; margin-top: 2px; }
.domain-charge { font-size: 15px; font-weight: 600; }
.charge-active { color: #E64A19; }
.charge-zero   { color: #424242; }

/* ── Site config rows ── */

.site-config-row {
  padding: 14px 0;
  border-bottom: 1px solid #2C2C2C;
}
.site-config-row:last-child { border-bottom: none; }

.site-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.site-domain {
  font-size: 15px;
  color: #E0E0E0;
  font-weight: 500;
}

.site-config-fields {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.site-config-fields.fields-disabled { opacity: 0.35; pointer-events: none; }

.inline-field { display: flex; flex-direction: column; gap: 5px; }
.inline-field label { font-size: 11px; color: #757575; text-transform: uppercase; letter-spacing: 0.4px; }
.input-unit { display: flex; align-items: center; gap: 6px; color: #757575; font-size: 13px; }
.input-unit input {
  width: 72px;
  background: #2C2C2C;
  border: 1px solid #3A3A3A;
  border-radius: 6px;
  color: #E0E0E0;
  padding: 7px 10px;
  font-size: 14px;
  outline: none;
}
.input-unit input:focus { border-color: #00BFA5; }

/* ── Toggle switch ── */

.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #3A3A3A;
  border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #757575;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .toggle-slider { background: rgba(0,191,165,0.25); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #00BFA5; }

/* ── Settings page ── */

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #2C2C2C;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 14px; color: #9E9E9E; }
.settings-value { font-size: 14px; color: #E0E0E0; }

.dest-options { display: flex; flex-direction: column; gap: 12px; }
.dest-option  { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.dest-option input[type="radio"] { accent-color: #00BFA5; width: 17px; height: 17px; }
.dest-label   { font-size: 15px; color: #BDBDBD; }

/* Stripe card element container */
#card-element {
  background: #2C2C2C;
  border: 1px solid #3A3A3A;
  border-radius: 8px;
  padding: 13px 14px;
  margin-bottom: 14px;
}

/* ── Misc ── */

.hint-text { font-size: 13px; color: #616161; line-height: 1.6; }
.loading   { color: #424242; padding: 20px 0; font-size: 14px; }
