/* =============================================
   Days of Success — main.css
   Restrained, editorial design.
   No pill buttons. No heavy shadows. No fog.
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* --- Custom Properties --- */
:root {
  --clr-bg: #111118;
  --clr-surface: rgba(255, 255, 255, 0.07);
  --clr-surface-solid: #1c1c26;
  --clr-border: rgba(255, 255, 255, 0.1);
  --clr-border-strong: rgba(255, 255, 255, 0.18);
  --clr-text: #f0f0f4;
  --clr-text-secondary: rgba(240, 240, 244, 0.65);
  --clr-text-muted: rgba(240, 240, 244, 0.38);
  --clr-accent: #e8b86d;
  --clr-accent-dark: #c99445;
  --clr-success: #5cba85;
  --clr-danger: #d95454;

  --font-family: 'Inter', system-ui, -apple-system, sans-serif;

  /* Radius — small and purposeful, not decorative */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;   /* reserved for sheet modals only */

  /* Shadows — almost nothing. Structure comes from borders. */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);

  --transition: 0.2s ease;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  font-family: inherit;
}

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

/* --- App Shell --- */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --- View Container --- */
.view {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* --- Background Image Layer --- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.5s ease;
}

/* Single clean overlay — enough to read text, not a fog */
.bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.20) 35%,
    rgba(0, 0, 0, 0.60) 100%
  );
}

/* --- Content above background --- */
.view-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--safe-top) + 12px);
  padding-bottom: calc(var(--safe-bottom) + 12px);
}

/* --- Header Bar --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  gap: 12px;
}

.header-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 1;
  text-align: center;
  color: var(--clr-text-secondary);
}

/* Icon button — no circle background, just the icon */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-secondary);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.icon-btn:active {
  color: var(--clr-text);
  background: rgba(255, 255, 255, 0.06);
}

/* --- Cards --- */
/* No blur, no heavy shadow — just a clean border */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--clr-border);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background var(--transition), opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  opacity: 0.82;
}

.btn-primary {
  background: var(--clr-accent);
  color: #111118;
}

.btn-primary:hover {
  background: var(--clr-accent-dark);
}

.btn-secondary {
  background: var(--clr-surface);
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
}

.btn-danger {
  background: var(--clr-danger);
  color: white;
}

.btn-full {
  width: 100%;
}

/* --- Form Elements --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--clr-accent);
}

.form-input::placeholder {
  color: var(--clr-text-muted);
}

/* --- Toggle Switch --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--clr-border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Toggle keeps pill shape — it's a functional control, not decoration */
.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  transition: background var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--clr-accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* --- Bottom Navigation ---
   Minimal text links, no floating card strips */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.25);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  color: var(--clr-text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  max-width: 110px;
}

.nav-btn:active {
  color: var(--clr-text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

/* --- Modal — bottom sheet, sharp top corners === */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 0 0 calc(var(--safe-bottom));
}

.modal {
  background: var(--clr-surface-solid);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--clr-border);
  width: 100%;
  max-width: 480px;
  padding: 28px 22px 24px;
  text-align: center;
}

.modal h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal p {
  color: var(--clr-text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
  margin-bottom: 22px;
}

/* --- Progress Bar — thin, precise line === */
.progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--clr-accent);
  border-radius: var(--radius-xs);
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Scrollable Panel --- */
.scroll-panel {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 18px;
}

.scroll-panel::-webkit-scrollbar {
  display: none;
}

/* --- Section Heading --- */
.section-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin: 22px 0 10px;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--clr-border);
  margin: 8px 0;
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  color: var(--clr-text-muted);
  text-align: center;
  font-size: 0.9rem;
}

/* --- Install Banner — clean bar, no shadow bubble === */
.install-banner {
  position: fixed;
  bottom: calc(var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--clr-surface-solid);
  border-top: 1px solid var(--clr-border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.install-banner.visible {
  transform: translateY(0);
}

.install-banner-text {
  flex: 1;
}

.install-banner-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1px;
}

.install-banner-text span {
  font-size: 0.78rem;
  color: var(--clr-text-secondary);
}

/* --- Utility Classes --- */
.text-accent { color: var(--clr-accent); }
.text-muted { color: var(--clr-text-muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }
