/* SANOV Customer Portal — Mobile-first
   Color palette pulled from screenshots:
   - Primary orange:  #b96935 (buttons, links, header gradient)
   - Primary dark:    #a05a2c (button hover)
   - Balance purple:  #5e3b91 (stats accent)
   - Text dark:       #1f2937
   - Text muted:      #6b7280
   - Bg light:        #f5f5f5
   - White card:      #ffffff
*/

:root {
  --primary: #b96935;
  --primary-dark: #a05a2c;
  --balance: #5e3b91;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f5f5f5;
  --card: #ffffff;
  --border: #e5e7eb;
  --success: #16a34a;
  --error: #dc2626;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Aggressively opt out of browser-forced dark mode (Chrome / Samsung Internet) */
html {
  color-scheme: only light !important;
  forced-color-adjust: none !important;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5 !important;
  color: #1f2937 !important;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Force-light: explicit background/foreground for elements that Samsung
   Internet's Night Mode aggressively recolors. Required because Samsung
   Internet ignores `color-scheme` for some legacy form/card elements. */
.auth-screen,
.card,
.amount-tile,
.tx-row,
.bottom-nav,
.modal-content,
.stat-card {
  background-color: #ffffff !important;
  color: #1f2937 !important;
}
.auth-screen { background: #ffffff !important; }
.app-header  { background: #b96935 !important; color: #ffffff !important; }
.btn-primary { background: #b96935 !important; color: #ffffff !important; }
.btn-danger  { background: #dc2626 !important; color: #ffffff !important; }
.form-control{
  background: #ffffff !important;
  color: #1f2937 !important;
  border-color: #e5e7eb !important;
}
.form-control::placeholder { color: #9ca3af !important; opacity: 1; }

/* Stop Samsung from picking its own "smart invert" colors for these states */
.auth-screen h2, .auth-screen .auth-foot { color: #1f2937 !important; }
.auth-screen .auth-foot { color: #6b7280 !important; }

body {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: 80px;        /* space for bottom nav */
  position: relative;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ----------------------- Header (with logo) ----------------------- */
.app-header {
  background: var(--primary);
  color: white;
  padding: 22px 20px 28px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  text-align: center;       /* center logo + heading */
}
.app-header .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.app-header .logo img {
  height: 44px;             /* ~50% bigger than before (was 28px) */
  width: auto;
  display: block;
  margin: 0 auto;
  filter: brightness(0) invert(1);  /* white logo on orange */
}
.app-header .logo .text-logo {
  font-size: 2.2rem;        /* ~50% bigger than before (was 1.5rem) */
  font-weight: 900;
  letter-spacing: 4px;
  color: white;
  font-family: "Arial Black", Impact, sans-serif;
}
.app-header h1 {
  font-size: 1.35rem;
  margin: 6px 0 4px;
  font-weight: 700;
}
.app-header p {
  font-size: 0.9rem;
  opacity: 0.92;
}

/* ----------------------- Stat strip (3 cards) ----------------------- */
.stat-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px;
}
.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 14px 6px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  cursor: default;
  text-decoration: none;
  color: inherit;
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:active { transform: scale(0.97); }
.stat-card .stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.stat-card .stat-value.purple { color: var(--balance); }
.stat-card .stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ----------------------- Sections ----------------------- */
.section {
  padding: 0 16px;
  margin-bottom: 16px;
}
.section h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.section h2 .count {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

/* ----------------------- Cards ----------------------- */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}
.card.center { text-align: center; }
.card .card-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.card .card-text {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ----------------------- Buttons ----------------------- */
.btn {
  display: inline-block;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: none;
  width: auto;
  padding: 8px 0;
}
.btn-danger {
  background: #dc2626;
  color: white;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-sm { padding: 8px 14px; font-size: 0.85rem; width: auto; }

/* ----------------------- Forms ----------------------- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(185, 105, 53, 0.1);
}
.password-wrap {
  position: relative;
}
.password-wrap .toggle-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 4px;
}
.form-link {
  text-align: right;
  margin-top: 4px;
  font-size: 0.85rem;
}

/* Remember-me row */
.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  font-size: 0.92rem;
  color: var(--text);
  user-select: none;
  cursor: pointer;
}
.remember-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}
.remember-row .hint {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 1px;
}

/* ----------------------- Centered auth card ----------------------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 24px;
  background: white;
}
.auth-screen .close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
}
.auth-screen .auth-logo {
  text-align: center;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-screen .auth-logo img {
  height: 60px;          /* ~50% bigger than before (was 38px) */
  width: auto;
  display: block;
  margin: 0 auto;
}
.auth-screen .auth-logo .text-logo {
  font-size: 2.7rem;     /* ~50% bigger than before (was 1.8rem) */
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--text);
  font-family: "Arial Black", Impact, sans-serif;
}
.auth-screen h2 {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
}
.auth-screen .auth-foot {
  text-align: center;
  margin-top: 24px;
  font-size: 0.92rem;
  color: var(--muted);
}
.auth-screen .auth-foot a {
  text-decoration: underline;
  font-weight: 600;
}

/* ----------------------- Top-up amount tiles ----------------------- */
.amount-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.amount-tile {
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.amount-tile:active { transform: scale(0.97); }
.amount-tile.selected {
  border-color: var(--primary);
  background: #fff7f1;
  box-shadow: 0 0 0 3px rgba(185, 105, 53, 0.08);
}
.amount-tile .amount-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}
.amount-tile .amount-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ----------------------- Transactions ----------------------- */
.tx-row {
  background: white;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tx-row .tx-info {
  flex: 1;
}
.tx-row .tx-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.tx-row .tx-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.tx-row .tx-amount {
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
}
.tx-row .tx-amount.positive { color: var(--success); }
.tx-row .tx-amount.negative { color: var(--text); }
.tx-row .tx-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 2px;
  display: inline-block;
}
.tx-status.success  { background: #dcfce7; color: #166534; }
.tx-status.pending  { background: #fef3c7; color: #92400e; }
.tx-status.failed,
.tx-status.refunded { background: #fee2e2; color: #991b1b; }

/* ----------------------- Alerts ----------------------- */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--error); }
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.alert-warn    { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }

/* ----------------------- Bottom nav ----------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: white;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.bottom-nav a {
  padding: 10px 4px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bottom-nav a.active { color: var(--primary); font-weight: 700; }
.bottom-nav a .icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* ----------------------- Modal ----------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}
.modal-content {
  background: white;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-content h3 {
  font-size: 1.25rem;
  margin-bottom: 14px;
  text-align: center;
}

/* ----------------------- Misc ----------------------- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-small { font-size: 0.85rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

@media (min-width: 481px) {
  body { box-shadow: 0 0 30px rgba(0,0,0,0.06); }
}