:root {
  --navy-dark: #0b1622;
  --navy-primary: #132238;
  --navy-light: #1e3557;
  --gold: #c59b27;
  --gold-hover: #dfb13c;
  --gold-glow: rgba(197, 155, 39, 0.25);
  --bg-gradient: linear-gradient(180deg, #0b1622 0%, #132238 100%);
  --surface-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 20px rgba(11,22,34,0.08);
  --shadow-lg: 0 12px 28px rgba(11,22,34,0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--surface-bg);
  color: var(--text-dark);
  padding-bottom: 90px;
  min-height: 100vh;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  background: var(--navy-dark);
  border-bottom: 1px solid rgba(197, 155, 39, 0.3);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  font-size: 1.6rem;
  color: var(--gold);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-light);
  line-height: 1.1;
}

.brand-text small {
  display: block;
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-greeting {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 500;
}

/* App Container */
.app-container {
  max-width: 650px;
  margin: 0 auto;
  padding: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: slideFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Banner */
.hero-card {
  background: var(--bg-gradient);
  border: 1px solid rgba(197, 155, 39, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  color: var(--text-light);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: var(--gold-glow);
  filter: blur(50px);
  border-radius: 50%;
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(197, 155, 39, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.hero-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-card p {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Quick Action Cards */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-primary);
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.action-tile {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  position: relative;
}

.action-tile:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.action-tile:active {
  transform: scale(0.98);
}

.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--navy-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.action-tile.gold-tile .tile-icon {
  background: #fef9e7;
  color: var(--gold);
}

.action-tile h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 4px;
}

.action-tile p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.lock-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 7px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Vault List & Downloads */
.vault-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vault-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 4px solid var(--gold);
}

.vault-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.vault-icon {
  font-size: 2rem;
  color: #dc2626;
}

.vault-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 4px;
}

.vault-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Search Frame / MLS Container */
.mls-container {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.mls-banner {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--navy-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--navy-light);
}

.btn-gold {
  background: var(--gold);
  color: #ffffff;
}

.btn-gold:hover {
  background: var(--gold-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #ffffff;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  background: #ffffff;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* Calculator Output */
.calc-result-box {
  background: var(--navy-dark);
  color: #ffffff;
  padding: 20px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  text-align: center;
  border: 1px solid rgba(197, 155, 39, 0.4);
}

.calc-result-box h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 6px;
}

.calc-result-box .amount {
  font-size: 1.9rem;
  font-weight: 800;
  color: #ffffff;
}

/* Bottom Glass Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 12px;
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-item i {
  font-size: 1.25rem;
}

.nav-item.active {
  color: var(--gold);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 22, 34, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #ffffff;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}
