/*
====================================================
DoseClock Homepage Styles
Phase 4 Package 1
Option C: clinical structure with modern polish
====================================================

Purpose:
- Keep the homepage calm and clinical.
- Improve tile spacing, visual hierarchy, hover/focus states.
- Avoid changing backend logic or template structure.
*/

.welcome,
.welcome-dashboard {
  width: min(100%, 1020px);
  margin-inline: auto;
}

.welcome-dashboard {
  display: grid;
  gap: clamp(1.25rem, 2vw, 1.75rem);
}

.welcome-hero {
  padding: clamp(1.35rem, 2.5vw, 2rem);
  background:
    radial-gradient(circle at top left, rgba(43, 140, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
  border: 1px solid var(--color-border, #d7e0eb);
  border-radius: var(--radius-xl, 1.25rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15, 23, 42, 0.06));
}

.welcome-hero__content {
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}

.welcome__title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  color: var(--color-heading, #0a2d6f);
  text-wrap: balance;
}

.welcome__icon {
  line-height: 1;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.welcome__title-text {
  line-height: 1.18;
}

.welcome__subtitle,
.welcome-intro {
  max-width: 68ch;
  margin: 0 auto;
  color: var(--color-muted, #5f6f82);
  font-size: clamp(1rem, 1vw, 1.05rem);
  line-height: 1.6;
}

.welcome-section {
  display: grid;
  gap: 0.9rem;
}

.welcome-section__header {
  text-align: left;
}

.welcome-section__title {
  margin: 0 0 0.25rem;
  color: var(--color-heading, #0a2d6f);
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.welcome-section__subtitle {
  max-width: 70ch;
  margin: 0;
  color: var(--color-muted, #5f6f82);
  font-size: 0.98rem;
  line-height: 1.55;
}

.tile-grid,
.tile-grid--primary,
.tile-grid--secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(0.85rem, 1.5vw, 1.1rem);
  align-items: stretch;
  margin-top: 0;
}

.tile {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-height: 118px;
  padding: 1.05rem;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(180deg, var(--color-primary-600, #12449e) 0%, var(--color-primary, #0a2d6f) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg, 1rem);
  box-shadow: 0 10px 24px rgba(10, 45, 111, 0.18);
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 140ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    border-color 160ms ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: auto -35px -45px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.tile--secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 44%),
    linear-gradient(180deg, var(--color-primary, #0a2d6f) 0%, var(--color-primary-700, #082658) 100%);
}

.tile:hover,
.tile:focus-visible {
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.025);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 16px 34px rgba(10, 45, 111, 0.24);
}

.tile:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(10, 45, 111, 0.18);
}

.tile__icon {
  z-index: 1;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-top: 0.05rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.85rem;
  font-size: 1.35rem;
  line-height: 1;
}

.tile__content {
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tile__label,
.tile__label-row {
  color: #ffffff;
}

.tile__label {
  display: block;
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.2;
}

.tile__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.tile__text {
  display: block;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.42;
}

.tile__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding-inline: 0.5rem;
  color: var(--color-primary, #0a2d6f);
  background: #ffffff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.tile:hover .tile__badge,
.tile:focus-visible .tile__badge {
  transform: scale(1.04);
}

@media (max-width: 768px) {
  .welcome-dashboard {
    gap: 1.15rem;
  }

  .welcome-hero {
    padding: 1.15rem;
  }

  .welcome-section__header {
    text-align: center;
  }

  .tile-grid,
  .tile-grid--primary,
  .tile-grid--secondary {
    grid-template-columns: 1fr;
  }

  .tile {
    min-height: 104px;
    padding: 1rem;
  }
}
