/* ==========================================================================
   Accounts360 — iOS-inspired theme
   Design tokens + Bootstrap component overrides. Loaded after Bootstrap on
   every page (auth, marketing, and the main app) so the look is consistent
   application-wide without needing to touch each page's markup.
   ========================================================================== */

:root {
  --blue: #007AFF;
  --indigo: #5856D6;
  --green: #34C759;
  --teal: #30B0C7;
  --orange: #FF9500;
  --red: #FF3B30;
  --sep: #E5E5EA;
  --text: #1C1C1E;
  --text2: #3A3A3C;
  --text3: #8E8E93;
  --bg: #F2F2F7;
  --grouped: #E5E5EA;

  --ios-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ios-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

body {
  font-family: var(--ios-font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.text-muted { color: var(--text3) !important; }
small, .small { color: var(--text2); }

/* ---- Cards ---- */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
.card-header {
  border-bottom: 1px solid var(--sep);
  border-radius: 16px 16px 0 0 !important;
  font-weight: 600;
  color: var(--text2);
}
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04) !important; }

/* ---- Buttons ---- */
.btn {
  border-radius: 12px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-sm { border-radius: 9px; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  border: none;
  box-shadow: 0 4px 12px rgba(0,122,255,.25);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #0071eb, #4f4dc4); }
.btn-success { background: linear-gradient(135deg, var(--green), var(--teal)); border: none; box-shadow: 0 4px 12px rgba(52,199,89,.25); }
.btn-danger { background: var(--red); border: none; }
.btn-warning { background: var(--orange); border: none; color: #fff; }

.btn-outline-primary { color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline-primary:hover { background: var(--blue); border-color: var(--blue); }
.btn-outline-secondary { color: var(--text2); border: 1.5px solid var(--sep); }
.btn-outline-secondary:hover { background: var(--text2); border-color: var(--text2); }
.btn-outline-danger { color: var(--red); border: 1.5px solid var(--red); }

/* ---- Forms ---- */
.form-control, .form-select {
  border: 1.5px solid var(--sep);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0,122,255,.12);
}
.form-control::placeholder { color: var(--text3); }
.form-control-sm, .form-select-sm { border-radius: 9px; padding: 6px 10px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-text { color: var(--text3); font-size: 12.5px; }

/* ---- Badges ---- */
.badge { border-radius: 8px; font-weight: 600; padding: 4px 9px; }
.bg-primary { background: var(--blue) !important; }
.bg-success { background: var(--green) !important; }
.bg-danger { background: var(--red) !important; }
.bg-warning { background: var(--orange) !important; }
.bg-secondary { background: var(--text3) !important; }
.bg-info { background: var(--teal) !important; }

/* ---- Tables ---- */
.table thead.table-light th, .table > :not(caption) > * > th {
  background: var(--bg);
  color: var(--text2);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .02em;
  border-bottom: 1px solid var(--sep);
}
.table > :not(caption) > * > td { border-color: var(--sep); vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: rgba(0,122,255,.04); }

/* ---- Nav tabs ---- */
.nav-tabs { border-bottom: 1px solid var(--sep); }
.nav-tabs .nav-link { border: none; color: var(--text3); font-weight: 600; border-radius: 0; }
.nav-tabs .nav-link.active { color: var(--blue); border-bottom: 2px solid var(--blue); background: transparent; }

/* ---- Sidebar (main app) ---- */
.sidebar-link { border-radius: 10px; font-weight: 500; }
.sidebar-link.active { background: rgba(255,255,255,.15); font-weight: 600; }

/* ---- Modals ---- */
.modal-content { border: none; border-radius: 18px; }
.modal-header { border-bottom: 1px solid var(--sep); }
.modal-footer { border-top: 1px solid var(--sep); }

/* ---- Alerts ---- */
.alert { border: none; border-radius: 12px; }
.alert-danger { background: rgba(255,59,48,.1); color: #c22a20; }
.alert-success { background: rgba(52,199,89,.1); color: #1f8a3b; }
.alert-warning { background: rgba(255,149,0,.1); color: #b56800; }
.alert-info { background: rgba(48,176,199,.1); color: #21808f; }

/* ---- iOS toggle switch (used for Remember Me, and reusable elsewhere) ---- */
.ios-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.ios-toggle input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.ios-toggle .track {
  position: absolute;
  inset: 0;
  background: var(--sep);
  border-radius: 999px;
  transition: background .2s ease;
}
.ios-toggle .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.ios-toggle input:checked ~ .track { background: var(--blue); }
.ios-toggle input:checked ~ .thumb { transform: translateX(18px); }

/* ---- Auth pages (login, 2FA) ---- */
.ios-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 0% 0%, #F0F4FF 0%, transparent 55%),
              radial-gradient(circle at 100% 100%, #FFF0F6 0%, transparent 55%),
              #F2F2F7;
}
.ios-auth-wrap { width: 100%; max-width: 380px; }
.ios-wordmark {
  text-align: center;
  margin-bottom: 20px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.08));
}
.ios-wordmark .accent { color: var(--blue); }
.ios-auth-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
}
.ios-auth-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--text3);
}
.ios-auth-footer a { color: var(--blue); font-weight: 700; text-decoration: none; }
.ios-back-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text3);
  text-decoration: none;
}
.ios-back-link:hover { color: var(--text2); }

.ios-code-input {
  font-family: var(--ios-mono);
  font-size: 32px;
  letter-spacing: 12px;
  text-align: center;
  border: 2px solid var(--sep);
  border-radius: 14px;
  padding: 14px 0;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.ios-code-input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}
