
/* ========================================
   FAMILY BIRTHDAY TRACKER
   Main theme and layout
======================================== */

:root {
  --background: #f3f6f8;
  --surface: #ffffff;
  --ink: #1d3040;
  --muted: #637381;
  --accent: #c76c67;
  --accent-dark: #ad5752;
  --accent-soft: #f8eeee;
  --border: #e3e9ed;
  --success: #39765b;
  --danger: #b54747;
  --radius: 16px;
  --shadow: 0 12px 35px rgba(29, 48, 64, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.app-shell {
  width: min(100% - 40px, 1100px);
  margin: 0 auto;
}

/* ========================================
   HEADER
======================================== */

.app-header {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-soft);
  font-size: 24px;
}

/* ========================================
   HERO
======================================== */

.hero {
  max-width: 650px;
  margin: 55px auto 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

.hero h1 {
  margin: 12px 0;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.15;
  letter-spacing: -2px;
  font-weight: 700;
}

.hero > p:last-child {
  max-width: 540px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 17px;
}

/* ========================================
   AUTHENTICATION
======================================== */

.auth-panel {
  width: min(100%, 520px);
  margin: 0 auto 50px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.auth-heading {
  margin-bottom: 26px;
}

.auth-heading h2 {
  margin: 0 0 8px;
  font-size: 25px;
  letter-spacing: -0.6px;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ========================================
   AUTHENTICATION TABS
======================================== */

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin-bottom: 26px;
  background: var(--background);
  border-radius: 12px;
}

.auth-tab {
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.auth-tab:hover {
  color: var(--ink);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(29, 48, 64, 0.08);
}

/* ========================================
   FORMS
======================================== */

.auth-form-panel form,
.birthday-editor form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form-panel label,
.birthday-editor label,
.list-toolbar label {
  display: block;
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(199, 108, 103, 0.13);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #bdc9d1;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  cursor: pointer;
}

.checkbox-label input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* ========================================
   BUTTONS
======================================== */

.button-primary,
.auth-form-panel button[type="submit"],
.birthday-editor button[type="submit"],
#show-birthday-form {
  min-height: 46px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
}

.auth-form-panel button[type="submit"] {
  width: 100%;
  margin-top: 5px;
}

.button-primary:hover,
.auth-form-panel button[type="submit"]:hover:not(:disabled),
.birthday-editor button[type="submit"]:hover:not(:disabled),
#show-birthday-form:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.button-secondary {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ========================================
   MESSAGES
======================================== */

.message {
  min-height: 20px;
  margin: 10px 0;
  color: var(--success);
  font-size: 13px;
}

.message.error {
  color: var(--danger);
}

/* ========================================
   DASHBOARD
======================================== */

.dashboard {
  margin: 40px 0;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.dashboard-header h2 {
  margin: 4px 0 8px;
  font-size: 28px;
  letter-spacing: -0.6px;
}

.dashboard-header p {
  margin-top: 0;
}

#user-greeting {
  color: var(--muted);
  font-size: 13px;
}

/* ========================================
   BIRTHDAY WORKSPACE
======================================== */

.birthday-workspace {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(29, 48, 64, 0.04);
}

.list-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 260px);
  align-items: end;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.list-toolbar h3,
.section-heading h3 {
  margin: 0 0 6px;
}

.list-toolbar p,
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.birthday-content {
  padding-top: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

#show-birthday-form {
  white-space: nowrap;
}

/* ========================================
   BIRTHDAY CARDS
======================================== */

.birthday-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.birthday-filters > div {
  min-width: 0;
}

.birthday-filters label {
  display: block;
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.birthday-filters button {
  min-height: 46px;
}

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

.birthday-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.birthday-card:hover {
  border-color: var(--accent);
}

.birthday-name {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 1.05rem;
}

.birthday-date {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-weight: 600;
}

.birthday-countdown {
  margin: 5px 0 0;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 650;
}

.birthday-age,
.birthday-relationship,
.birthday-notes,
.birthday-gift-ideas {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.birthday-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.birthday-actions button {
  padding: 8px 12px;
  font-size: 0.85rem;
}

#birthday-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  background: #f8fafb;
  border-radius: 12px;
}

/* ========================================
   BIRTHDAY EDITOR
======================================== */

.birthday-editor {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafb;
}

.birthday-editor h3 {
  margin-top: 0;
  margin-bottom: 20px;
}

.date-fields {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1.3fr;
  gap: 12px;
}

.date-fields > div {
  min-width: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* ========================================
   FOOTER
======================================== */

.app-footer {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* ========================================
   ACCESSIBILITY
======================================== */

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(199, 108, 103, 0.45);
  outline-offset: 3px;
}

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

/* ========================================
   RESPONSIVE LAYOUT
======================================== */

@media (max-width: 650px) {
  .app-shell {
    width: min(100% - 32px, 520px);
  }

  .hero {
    margin: 38px auto 30px;
  }

  .hero h1 {
    letter-spacing: -1.5px;
  }

  .hero > p:last-child {
    font-size: 15px;
  }

  .auth-panel {
    padding: 24px 20px;
    border-radius: 17px;
  }

  .dashboard-header {
    align-items: flex-start;
  }

  .birthday-workspace {
    padding: 18px;
  }

  .list-toolbar {
    grid-template-columns: 1fr;
  }

  .birthday-filters {
    grid-template-columns: 1fr 1fr;
  }

  .birthday-filters > div:first-child {
    grid-column: 1 / -1;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .birthday-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .birthday-actions {
    width: 100%;
  }

  .date-fields {
    grid-template-columns: 1fr 1fr;
  }

  .date-fields > div:last-child {
    grid-column: 1 / -1;
  }

  .birthday-editor {
    padding: 18px;
  }
}

@media (max-width: 380px) {
  .auth-panel {
    padding: 20px 16px;
  }

  .dashboard-header {
    flex-direction: column;
  }

  .dashboard-header .button-secondary {
    align-self: flex-start;
  }
}


/* Selective sharing */
.sharing-management {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface, #fff);
}

.sharing-form,
.shared-member {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.sharing-form > div {
  flex: 1;
}

.sharing-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.sharing-form select {
  width: 100%;
  min-height: 2.75rem;
}

.sharing-list-heading {
  margin: 1.25rem 0 0.5rem;
}

.sharing-members {
  display: grid;
  gap: 0.65rem;
}

.shared-member {
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #d9e1e7);
  border-radius: 0.75rem;
}

.shared-member-details {
  display: grid;
  gap: 0.2rem;
}

.shared-member-details span {
  color: var(--muted, #5b6871);
  font-size: 0.925rem;
}

@media (max-width: 560px) {
  .sharing-form,
  .shared-member {
    align-items: stretch;
    flex-direction: column;
  }
}
