/* My Safety Checkup — Senior-friendly styles */

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

:root {
  --blue: #1B5E7B;
  --blue-dark: #154A61;
  --blue-light: #E8F1F5;
  --green: #2E7D32;
  --green-light: #E8F5E9;
  --bg: #FAF9F7;
  --white: #ffffff;
  --text: #2D2D2D;
  --text-light: #5A5A5A;
  --border: #E0DEDA;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px;
  line-height: 1.2;
}

.header p {
  font-size: 1.15rem;
  color: var(--text-light);
  margin: 0;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px;
}

.card p {
  margin: 0 0 20px;
  font-size: 1.05rem;
  color: var(--text-light);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
  min-height: 52px;
  min-width: 44px;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn-secondary:hover {
  background: var(--blue-light);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  display: block;
  width: 100%;
}

/* Form */
.email-form {
  margin-top: 8px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-input {
  padding: 16px;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}

.email-input:focus {
  border-color: var(--blue);
}

.email-input::placeholder {
  color: #999;
}

/* Messages */
.message {
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 1.05rem;
  display: none;
}

.message-success {
  background: var(--green-light);
  color: var(--green);
}

.message-error {
  background: #FDECEA;
  color: #C62828;
}

.message.show {
  display: block;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 0.85rem;
}

.footer a {
  color: var(--blue);
  text-decoration: none;
}

/* ---- Checklist page styles ---- */

/* Progress bar */
.progress-bar {
  background: var(--white);
  border-radius: 12px;
  padding: 24px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.progress-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--blue);
  margin: 0 0 12px;
}

.progress-track {
  background: #E8E6E3;
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
}

.progress-fill {
  background: var(--blue);
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Section */
.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0;
}

.section-complete .section-number {
  background: var(--green);
}

/* Step items */
.step-item {
  background: var(--white);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step-main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.step-checkbox {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  cursor: pointer;
}

.step-checkbox:hover {
  border-color: var(--blue);
}

.step-item.completed .step-checkbox {
  background: var(--green);
  border-color: var(--green);
}

.step-checkbox svg {
  display: none;
  width: 20px;
  height: 20px;
}

.step-item.completed .step-checkbox svg {
  display: block;
}

.step-label {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

.step-item.completed .step-label {
  color: var(--text-light);
}

.step-toggle {
  background: var(--blue-light);
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.step-toggle:hover {
  background: #D0E4EC;
}

.toggle-text {
  font-size: 0.85rem;
}

.toggle-arrow {
  display: none;
}


/* Expandable details */
.step-details {
  display: none;
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
}

.step-item.expanded .step-details {
  display: block;
}

.step-details p {
  font-size: 1rem;
  color: var(--text-light);
  margin: 16px 0 0;
  line-height: 1.6;
}

.step-details .step-link {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 24px;
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}

.step-details .step-link:hover {
  background: #D0E4EC;
}

.step-details .tip {
  margin-top: 16px;
  padding: 12px 16px;
  background: #FFF8E1;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #5D4037;
}

.step-details .tip strong {
  color: #4E342E;
}

/* Celebration overlay */
.celebration {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.celebration.show {
  display: flex;
}

.celebration-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.celebration-card h2 {
  font-size: 1.5rem;
  color: var(--blue);
  margin: 0 0 16px;
}

.celebration-card p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 0 0 24px;
  line-height: 1.6;
}

.celebration-card .btn {
  margin-top: 8px;
}

/* User bar */
.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.user-bar button {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
  min-height: 44px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 24px;
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .container {
    padding: 20px 16px;
  }

  .card, .step-item, .progress-bar {
    padding: 24px 20px;
  }

  .step-main {
    padding: 16px 20px;
  }

  .step-details {
    padding: 0 20px 20px;
  }
}

/* Print styles */
@media print {
  body { background: white; }
  .user-bar, .step-toggle, .btn { display: none !important; }
  .step-details { display: block !important; border-top: none; }
  .celebration { display: none !important; }
}
