/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #d8dee8;
  --paper: #f7fafc;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --coral: #f9735b;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #f7fafc 0%, #eef6f4 46%, #fff4ef 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.home-nav,
.user-menu,
.birthday-row,
.hero,
.hero-panel {
  display: flex;
  align-items: center;
}

.home-nav {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 56px;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.user-menu {
  gap: 14px;
  color: var(--muted);
}

.hero {
  min-height: calc(100vh - 180px);
  justify-content: space-between;
  gap: 56px;
}

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

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

.hero h1,
.dashboard-header h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p,
.dashboard-header p {
  max-width: 600px;
  color: var(--muted);
  font-size: 20px;
}

.google-button,
.secondary-button,
.secondary-link,
.danger-button,
.row-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.secondary-link {
  padding: 0 14px;
}

.danger-button {
  padding: 0 14px;
  border-color: #fecaca;
  color: #991b1b;
}

.danger-button:hover {
  background: #fff1f2;
}

.google-button {
  margin-top: 16px;
  padding: 0 22px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.google-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  padding: 0 14px;
}

.hero-panel {
  width: min(360px, 100%);
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.mini-date,
.date-pill {
  display: grid;
  place-items: center;
  width: 64px;
  min-width: 64px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--coral);
  color: #ffffff;
}

.mini-date strong,
.date-pill strong {
  font-size: 24px;
  line-height: 1;
}

.date-pill span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.hero-panel p,
.hero-panel h2,
.hero-panel span {
  margin: 0;
}

.hero-panel p,
.hero-panel span {
  color: var(--muted);
}

.dashboard {
  padding-bottom: 32px;
}

.dashboard-header {
  margin-bottom: 32px;
}

.dashboard-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-title-row h1 {
  margin-bottom: 18px;
}

.dashboard-title-row .google-button {
  flex: 0 0 auto;
  margin-top: 8px;
}

.birthday-list {
  display: grid;
  gap: 20px;
}

.birthday-month-section {
  display: grid;
  gap: 10px;
}

.birthday-month-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 12px 2px 10px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.22);
  background: linear-gradient(135deg, #f7fafc 0%, #eef6f4 46%, #fff4ef 100%);
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.birthday-row {
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.birthday-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  min-width: 52px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e6f3f1;
  color: var(--accent-dark);
  font-size: 20px;
  font-weight: 800;
}

.birthday-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.birthday-details {
  min-width: 0;
  flex: 1;
}

.birthday-details h2 {
  margin-bottom: 3px;
  font-size: 19px;
  line-height: 1.2;
}

.birthday-details p,
.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.birthday-details span {
  color: var(--accent);
}

.age {
  display: grid;
  align-items: center;
  justify-items: end;
  color: var(--muted);
  font-weight: 800;
}

.age-label {
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
}

.age strong {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.row-action-link {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  opacity: 0.72;
}

.row-action-link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  opacity: 1;
}

.row-action-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.empty-state,
.flash {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.empty-state {
  padding: 36px;
}

.empty-state .google-button {
  margin-top: 18px;
}

.flash {
  margin-bottom: 24px;
  padding: 12px 16px;
}

.flash.alert {
  border-color: #fecaca;
  color: #991b1b;
}

.flash.notice {
  border-color: #99f6e4;
  color: #115e59;
}

.form-page {
  max-width: 860px;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 24px;
}

.form-header h1 {
  margin-bottom: 0;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.birthday-form {
  display: grid;
  gap: 18px;
}

.form-section,
.form-errors,
.premium-panel,
.settings-panel,
.integration-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.form-section {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.form-section h2,
.form-errors h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

.date-grid {
  align-items: start;
  grid-template-columns: minmax(170px, 1.2fr) minmax(92px, 0.6fr) minmax(150px, 1fr) minmax(130px, 0.8fr);
}

.field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.compact-field {
  max-width: 360px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field input,
.field select,
.field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.field input {
  padding: 0 12px;
}

.field select {
  padding: 0 36px 0 12px;
}

.field textarea {
  padding: 12px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-actions .google-button {
  margin-top: 0;
}

.events-editor,
.events-list {
  display: grid;
  gap: 18px;
}

.add-event-button {
  justify-self: start;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: #991b1b;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.form-errors {
  padding: 16px 18px;
  border-color: #fecaca;
  color: #991b1b;
}

.form-errors ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.premium-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 26px;
  padding: 24px;
}

.premium-panel h2 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.2;
}

.premium-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.premium-form {
  display: grid;
  align-content: start;
  gap: 18px;
}

.integration-alert {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-color: #fecaca;
  color: #991b1b;
  font-weight: 700;
}

.integration-alert a {
  color: var(--accent-dark);
}

.settings-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 24px;
}

.settings-panel h2 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.2;
}

.settings-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.settings-actions .google-button {
  margin-top: 0;
}

@media (max-width: 760px) {
  .home-nav,
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-nav {
    margin-bottom: 36px;
  }

  .hero {
    min-height: auto;
    gap: 34px;
  }

  .hero h1,
  .dashboard-header h1 {
    font-size: 44px;
  }

  .hero p,
  .dashboard-header p {
    font-size: 18px;
  }

  .user-menu,
  .birthday-row,
  .dashboard-title-row,
  .form-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-title-row .google-button,
  .form-actions .google-button,
  .form-actions .secondary-button,
  .form-actions .danger-button {
    width: 100%;
  }

  .two-columns,
  .date-grid,
  .premium-panel,
  .settings-panel {
    grid-template-columns: 1fr;
  }

  .settings-actions,
  .integration-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-actions .google-button,
  .settings-actions .secondary-button {
    width: 100%;
  }

  .compact-field {
    max-width: none;
  }

  .birthday-row {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    width: auto;
  }

  .birthday-avatar {
    grid-row: span 2;
  }

  .birthday-details {
    grid-column: 2 / -1;
  }

  .date-pill,
  .age {
    grid-row: 2;
  }

  .date-pill {
    grid-column: 2;
  }

  .age {
    grid-column: 3;
    justify-items: start;
  }

  .row-action-link {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}
