/* The Haven PDX — Public Styles
   Matches the admin panel: light grey background, purple accent
*/

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

:root {
  --purple:       #5b3fa6;
  --purple-dark:  #3d2a72;
  --purple-light: #f5f0ff;
  --purple-mid:   #7b5fc4;

  --bg:           #f4f3f8;
  --bg-surface:   #ffffff;
  --bg-raised:    #f0eef8;

  --text:         #1a1a1a;
  --text-muted:   #666;
  --text-faint:   #999;

  --border:       #e0e0e0;
  --border-focus: #5b3fa6;

  --success-bg:    #e8f5e9;
  --success-text:  #2e7d32;
  --success-border:#c8e6c9;
  --error-bg:      #ffebee;
  --error-text:    #c62828;
  --error-border:  #ffcdd2;
  --info-bg:       #f5f0ff;
  --info-text:     #5b3fa6;
  --info-border:   #d0bfff;

  --radius:    8px;
  --radius-sm: 6px;
  --shadow:    0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(91,63,166,0.1);
}

/* -------------------------------------------------------------------------
   Base
------------------------------------------------------------------------- */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); text-decoration: underline; }

/* -------------------------------------------------------------------------
   Logo
------------------------------------------------------------------------- */
.site-logo {
  text-align: center;
  padding: 1.25rem 0 0;
  background: var(--bg);
}
.site-logo img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 2px 12px rgba(91,63,166,0.15);
  transition: transform 0.2s;
}
.site-logo a:hover img {
  transform: scale(1.04);
}

/* -------------------------------------------------------------------------
   Header
------------------------------------------------------------------------- */
.site-header {
  background: var(--purple);
  color: white;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.site-header .brand {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-header nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.site-header nav a {
  color: rgba(255,255,255,0.82);
  font-size: 0.875rem;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.site-header nav a:hover {
  color: white;
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

/* -------------------------------------------------------------------------
   Main
------------------------------------------------------------------------- */
.site-main {
  max-width: 680px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* -------------------------------------------------------------------------
   Footer
------------------------------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-faint);
  font-size: 0.82rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

/* -------------------------------------------------------------------------
   Cards
------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }

/* -------------------------------------------------------------------------
   Shift cards
------------------------------------------------------------------------- */
.shift-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-left-color 0.15s;
}
.shift-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--purple-dark);
}
.shift-card.full { opacity: 0.55; }
.shift-meta { flex: 1; min-width: 0; }
.shift-title { font-size: 1rem; font-weight: 600; color: var(--purple); }
.shift-details { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.2rem; line-height: 1.4; }
.shift-slots { font-size: 0.82rem; margin-top: 0.4rem; font-weight: 500; }
.shift-slots.open { color: #2e7d32; }
.shift-slots.full { color: #c62828; }
.shift-action { flex-shrink: 0; padding-top: 0.1rem; }

.date-header {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 1.75rem 0 0.6rem;
}

/* -------------------------------------------------------------------------
   Forms
------------------------------------------------------------------------- */
.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.3rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

input[type=text],
input[type=email],
input[type=tel],
input[type=password],
select,
textarea {
  width: 100%;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(91,63,166,0.1);
}

textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.3rem; }

.radio-group { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.25rem; }
.radio-group label {
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
  padding: 0.3rem 0;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* -------------------------------------------------------------------------
   Buttons
------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: center;
  white-space: nowrap;
  min-height: 44px;
  line-height: 1.2;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--purple);
  color: white;
}
.btn-primary:hover {
  background: var(--purple-dark);
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(91,63,166,0.25);
}

.btn-outline {
  background: white;
  color: var(--purple);
  border: 1.5px solid var(--purple);
}
.btn-outline:hover {
  background: var(--purple-light);
  color: var(--purple-dark);
  text-decoration: none;
}

.btn-ghost {
  background: var(--bg-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); text-decoration: none; }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; min-height: 36px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; display: block; }
.btn-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Alerts
------------------------------------------------------------------------- */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.alert-error   { background: var(--error-bg);   color: var(--error-text);   border: 1px solid var(--error-border); }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid var(--info-border); }

/* -------------------------------------------------------------------------
   Typography
------------------------------------------------------------------------- */
h1 {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
  color: var(--purple);
  line-height: 1.2;
  font-weight: 700;
}
h2 { font-size: 1.15rem; margin-bottom: 0.6rem; line-height: 1.3; color: var(--text); }
.page-intro { color: var(--text-muted); margin-bottom: 1.25rem; font-size: 0.95rem; }

/* -------------------------------------------------------------------------
   Hero
------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}
.hero h1 { font-size: 1.9rem; }
.hero .page-intro { font-size: 1rem; }
.hero .btn-row { justify-content: center; margin-top: 1.25rem; }

/* -------------------------------------------------------------------------
   Account header
------------------------------------------------------------------------- */
.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.account-header h1 { margin-bottom: 0.1rem; }

/* -------------------------------------------------------------------------
   Recurring opt-in box
------------------------------------------------------------------------- */
.recurrence-box {
  background: var(--purple-light);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}
.recurrence-box label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 400;
}

/* -------------------------------------------------------------------------
   Utilities
------------------------------------------------------------------------- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-center { text-align: center; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--purple-light);
  color: var(--purple);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* -------------------------------------------------------------------------
   Mobile
------------------------------------------------------------------------- */
@media (max-width: 540px) {
  .site-main { margin: 1rem auto; padding: 0 0.75rem; }
  .form-row-2 { grid-template-columns: 1fr; }
  .shift-card { flex-wrap: wrap; }
  .shift-action { width: 100%; }
  .shift-action .btn { width: 100%; }
  h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.5rem; }
  .card { padding: 1.1rem; }
  .btn-row { gap: 0.5rem; }
  .btn-row .btn { flex: 1 1 auto; }
}

@media (max-width: 430px) {
  .site-header { padding: 0.75rem 1rem; }
  .site-header .brand { font-size: 1rem; }
  .site-header nav a { font-size: 0.82rem; padding: 0.3rem 0.5rem; }
}
