/* HubZA premium mobile-first dashboard */
:root {
  color-scheme: light;
  --primary: #0F766E;
  --primary-hover: #115E59;
  --accent: #14B8A6;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  --radius: 20px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  background: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 120px;
  display: grid;
  gap: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

.brand-label {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 18px;
  color: var(--muted);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.nav-pill:hover {
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary);
  border-color: rgba(20, 184, 166, 0.18);
}

.nav-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.location-pill-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary);
}

.location-pill-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.location-pill-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.avatar-btn {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.avatar-btn:hover {
  transform: translateY(-1px);
}

.hero-section {
  display: grid;
  gap: 20px;
}

.hero-main {
  display: grid;
  gap: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-main h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.02;
}

.hero-text {
  margin: 18px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1rem;
}

.search-card {
  display: grid;
  gap: 16px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

.search-icon {
  font-size: 1rem;
  color: var(--accent);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  color: var(--text);
}

.search-button {
  min-width: 120px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.search-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.hero-actions {
  display: grid;
  gap: 16px;
}

.action-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.2);
}

.action-card span {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary);
  font-size: 1.25rem;
}

.action-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-side {
  display: grid;
  gap: 20px;
}

.weather-card,
.location-card {
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
}

.weather-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.weather-card-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(20, 184, 166, 0.12);
  font-size: 1.5rem;
  color: var(--primary);
}

.weather-info {
  display: grid;
  gap: 6px;
}

.weather-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.weather-temp {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 800;
}

.weather-status {
  margin: 0;
  color: var(--muted);
}

.weather-details p,
.location-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.location-card-title {
  margin: 0 0 16px;
  color: var(--text);
  font-weight: 700;
}

.location-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--primary);
  font-weight: 700;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.25rem);
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.link-button {
  align-self: center;
  padding: 12px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.18);
}

.live-grid,
.tool-grid,
.recent-grid {
  display: grid;
  gap: 16px;
}

.live-grid {
  grid-template-columns: 1fr;
}

.live-card {
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.live-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.live-card-head strong {
  font-size: 1rem;
  color: var(--text);
}

.live-value {
  margin-top: 14px;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.live-change {
  font-weight: 700;
  color: var(--primary);
}

.live-change.down {
  color: #dc2626;
}

.tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.2);
}

.tool-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary);
  font-size: 1.5rem;
}

.tool-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.download-section {
  display: grid;
  gap: 16px;
}

.download-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06), rgba(20, 184, 166, 0.12));
  box-shadow: var(--shadow);
}

.download-copy h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.download-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.download-actions {
  display: grid;
  gap: 10px;
  min-width: 240px;
}

.download-status-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}

.download-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.download-button,
.auth-submit {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.download-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 20px rgba(15, 118, 110, 0.16);
}

.download-button:hover,
.auth-submit:hover {
  transform: translateY(-1px);
}

.download-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  padding: 20px;
  background: rgba(15, 23, 42, 0.64);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-modal.open {
  display: flex;
}

.auth-modal-card {
  position: relative;
  width: min(100%, 420px);
  border-radius: 24px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.auth-modal-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.auth-modal-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  font-weight: 600;
  color: var(--text);
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.auth-submit {
  margin-top: 4px;
  background: var(--primary);
  color: #fff;
}

.app-download-shell {
  min-height: 100vh;
  padding: 32px 20px 80px;
  background: linear-gradient(145deg, #f8fafc 0%, #ecfeff 100%);
}

.app-download-card {
  max-width: 760px;
  margin: 0 auto;
  border-radius: 28px;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
}

.app-download-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.55rem);
}

.app-download-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.app-download-actions {
  display: grid;
  gap: 12px;
}

.store-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.store-button.secondary {
  background: #fff;
  color: var(--primary);
  border-color: rgba(15, 118, 110, 0.2);
}

.store-button.disabled {
  background: #e2e8f0;
  color: var(--muted);
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.app-meta .status-pill {
  background: rgba(20, 184, 166, 0.12);
}

.recent-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-card {
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.page-footer {
  padding: 22px 0 12px;
  color: var(--muted);
  text-align: center;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
  z-index: 30;
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  border-radius: 16px;
  padding: 10px 8px;
  transition: background 0.3s ease, color 0.3s ease;
}

.nav-item.active {
  color: var(--primary);
  background: rgba(20, 184, 166, 0.12);
}

.nav-item:hover {
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .hero-section {
    grid-template-columns: 1.7fr 1fr;
    align-items: start;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bottom-nav {
    display: none;
  }
}

@media (max-width: 767px) {
  .page-shell {
    padding-bottom: 140px;
  }

  .page-nav {
    display: none;
  }

  .hero-main,
  .weather-card,
  .location-card,
  .action-card,
  .live-card,
  .tool-card,
  .recent-card {
    border-radius: 22px;
  }

  .tool-grid,
  .recent-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 20px 16px 140px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right {
    justify-content: space-between;
  }

  .hero-section {
    gap: 16px;
  }

  .search-field {
    flex-direction: column;
    align-items: stretch;
  }

  .search-button {
    width: 100%;
  }

  .weather-card-header,
  .live-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
