/* WellDay Web Portal - Premium Stylesheet */

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

:root {
  /* Surfaces mirror the app's Material 3 dark scheme (src/theme.js), so the
     site and the app read as one product rather than two designs. */
  --bg-gradient: linear-gradient(160deg, #111318 0%, #161A21 55%, #111318 100%);
  --bg-card: rgba(30, 33, 40, 0.72);
  --bg-card-hover: rgba(40, 44, 54, 0.86);
  --border-color: #2A2E37;
  --border-hover: rgba(56, 189, 248, 0.45);

  /* Brand gradient sampled straight from the app icon: blue -> teal -> green. */
  --logo-gradient: linear-gradient(135deg, #2E87DD 0%, #20B2CB 55%, #27AE64 100%);

  /* The app's "water" blue. */
  --primary: #38BDF8;
  --primary-hover: #7DD3FC;
  --primary-glow: rgba(56, 189, 248, 0.25);

  /* The app's "steps" green — the leaf on the icon. */
  --accent: #34D399;
  --accent-hover: #6EE7B7;
  --accent-glow: rgba(52, 211, 153, 0.22);

  /* Destructive actions keep their own scale. --accent is green now, so
     warnings and errors must not borrow it. */
  --danger: #FB7185;
  --danger-hover: #FDA4AF;
  --danger-glow: rgba(251, 113, 133, 0.25);

  --success: #34D399;
  --success-glow: rgba(52, 211, 153, 0.2);

  /* onSurface / onSurfaceVariant / outline from the app's dark scheme. */
  --text-main: #E2E2E6;
  --text-muted: #C4C7C5;
  --text-dark: #8E918F;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.55), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The decorative blobs are positioned past the viewport edges, so the clip has
   to be on <html> too — overflow-x on <body> alone still lets the document
   scroll sideways on phones. */
html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Background glowing blobs */
.glow-blob {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
}

.blob-1 {
  top: -10%;
  right: -5%;
}

.blob-2 {
  bottom: 10%;
  left: -10%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  width: 500px;
  height: 500px;
}

header {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--logo-gradient);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  background: linear-gradient(to right, #ffffff, #7DD3FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem 1.5rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Glass Card Component */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--logo-gradient);
  opacity: 0.8;
}

/* Headings */
h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 2.8rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #DCE6F2 45%, #7DD3FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #f3f4f6;
  letter-spacing: -0.01em;
}

p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

/* Home Layout styling */
.hero-section {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Ad-support disclosure under the feature grid. */
.hero-note {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-dark);
  max-width: 34rem;
  margin: 0 auto 2.5rem;
}

.hero-note a {
  color: var(--primary-hover);
  text-decoration: underline;
}

.feature-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 1.25rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal);
  text-align: left;
}

.feature-item:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 20px -10px var(--primary-glow);
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.feature-item:nth-child(2) .feature-icon {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.24);
  color: var(--accent);
}

.feature-item h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: white;
}

.feature-item p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Nav Links for Footer & Portal */
.links-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2E87DD 0%, #20B2CB 100%);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.38);
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #E11D48 100%);
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(251, 113, 133, 0.38);
  background: linear-gradient(135deg, var(--danger-hover) 0%, var(--danger) 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Legal Documents formatting */
.legal-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.legal-content section {
  margin-bottom: 2rem;
}

.legal-content ul, .legal-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.last-updated {
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  font-style: italic;
}

.back-btn-container {
  margin-bottom: 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--primary-hover);
}

/* Delete Account Page specific styling */
.delete-portal {
  max-width: 600px;
  margin: 0 auto;
}

.auth-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.form-control {
  background: rgba(17, 19, 24, 0.7);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: white;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: white;
  color: #1f2937;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid #e5e7eb;
}

.google-btn:hover {
  background: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.google-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-dark);
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.divider:not(:empty)::before {
  margin-right: .5em;
}

.divider:not(:empty)::after {
  margin-left: .5em;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.user-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--logo-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  text-align: left;
}

.user-name {
  font-weight: 600;
  color: white;
}

.user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.warning-card {
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: left;
}

.warning-card h4 {
  color: var(--danger-hover);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.warning-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--danger-hover);
}

.error-message {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.26);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-align: left;
}

.success-card {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
}

.success-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid var(--success);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 0 20px var(--success-glow);
}

.success-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  color: white;
  margin-bottom: 0.75rem;
}

.success-card p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hidden {
  display: none !important;
}

/* Spinner */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top: 3px solid white;
  width: 1.25rem;
  height: 1.25rem;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

footer {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--primary-hover);
}

.copyright {
  color: var(--text-dark);
  font-size: 0.85rem;
}

/* Responsive adjustment */
@media (max-width: 768px) {
  body {
    padding-bottom: 2rem;
  }
  
  header {
    padding: 1.5rem 1rem;
  }
  
  .glass-card {
    padding: 2rem 1.25rem;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .links-container {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* App screenshot gallery — scrolls sideways on phones rather than shrinking
   the shots to illegibility. */
.shots-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--text-main);
}

.shots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0 0 1rem;
  margin-bottom: 2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.shot {
  margin: 0;
  flex: 0 0 210px;
  scroll-snap-align: center;
  text-align: center;
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (min-width: 720px) {
  .shots {
    justify-content: center;
    flex-wrap: nowrap;
  }
  .shot { flex: 0 0 200px; }
}
