/* =======================================================
   Guardian Legacy - Confidential Client Data Collection
   Brand Colors: #0a203d (Navy), #b0903d (Gold), #1e1e1e (Dark)
   ======================================================= */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --navy: #0a203d;
  --gold: #b0903d;
  --dark: #1e1e1e;
  --gold-dark: #8a7430;
  --slate: #475569;
  --light-bg: #f8fafc;
  --border: #cbd5e1;
  --text-muted: #64748b;
}

/* ==================== GLOBAL STYLES ==================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--light-bg);
  color: var(--dark);
  line-height: 1.6;
}

/* ==================== HEADER ==================== */
.gl-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--navy);
  color: white;
  text-align: center;
  padding: 1.25rem 1rem 1rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(10, 32, 61, 0.3);
}

.gl-header .logo {
  font-family: 'EB Garamond', serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  letter-spacing: 0.5px;
}

.gl-header .tagline {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.gl-header h1 {
  font-family: 'EB Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 1rem;
  color: #fff;
}

/* Progress Bar */
.progress-wrap {
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
}

.progress {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress .bar {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(176, 144, 61, 0.5);
}

.step-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

/* ==================== LAYOUT ==================== */
.container {
  margin-top: 12rem;
  padding: 2rem 1rem 4rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

main.container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  margin-top: 11rem;
}

/* ==================== TYPOGRAPHY ==================== */
h2 {
  font-family: 'EB Garamond', serif;
  color: var(--navy);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.5rem;
}

h3 {
  font-family: 'EB Garamond', serif;
  color: var(--navy);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
}

h4 {
  font-family: 'EB Garamond', serif;
  color: var(--navy);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
}

p.section-desc,
p.instruction {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.required {
  color: #dc2626;
  font-weight: 600;
}

/* ==================== NOTICE BLOCKS ==================== */
.notice-block {
  background: #f1f5f9;
  border-left: 4px solid var(--gold);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
}

.notice-block.confidentiality {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.notice-block.security-req {
  background: #dbeafe;
  border-left-color: #3b82f6;
}

.notice-block h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--navy);
}

.notice-block p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==================== STEPS & NAVIGATION ==================== */
.step {
  display: none !important;
  padding: 2rem;
}

.step.active {
  display: block !important;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ==================== BUTTONS ==================== */
button {
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

button:hover {
  background: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(176, 144, 61, 0.3);
}

button:active {
  transform: translateY(0);
}

button.back {
  background: #94a3b8;
}

button.back:hover {
  background: #64748b;
}

button.submit {
  background: var(--navy);
  padding: 0.875rem 2.5rem;
  font-size: 1.05rem;
}

button.submit:hover {
  background: #0c2847;
}

button.add-more {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

button.add-more:hover {
  background: var(--gold);
  color: white;
  transform: none;
}

/* ==================== ROLE SELECTION ==================== */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.role-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.role-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(176, 144, 61, 0.15);
  transform: translateY(-2px);
}

.role-card input[type="radio"] {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.role-card input[type="radio"]:checked ~ .role-title {
  color: var(--gold);
}

.role-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 0.5rem;
  padding-right: 2rem;
}

.role-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==================== DEFENSE METHODOLOGY ==================== */
.defense-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.defense-item {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-left: 4px solid var(--gold);
  padding: 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.defense-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.defense-item h3 {
  color: var(--navy);
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.defense-item p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--slate);
  margin: 0;
}

/* ==================== FORMS ==================== */
.form-section {
  margin-bottom: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--slate);
  gap: 0.4rem;
}

label.full-width {
  grid-column: 1 / -1;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="file"],
textarea,
select {
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background: white;
  transition: all 0.25s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 144, 61, 0.15);
}

input::placeholder {
  color: #94a3b8;
}

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

/* ==================== SOCIAL MEDIA ==================== */
.social-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.social-platform {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.platform-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.social-platform input,
.social-platform select {
  margin: 0;
}

/* ==================== CHECKBOXES ==================== */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.checkbox-grid label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.checkbox-grid label:hover {
  background: #e2e8f0;
}

.checkbox-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ==================== FILE UPLOAD ==================== */
.file-upload {
  display: block;
  margin: 1rem 0;
}

.file-upload input[type="file"] {
  display: none;
}

.file-label {
  display: inline-block;
  background: var(--gold);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.file-label:hover {
  background: var(--gold-dark);
}

/* ==================== AUTHORIZATION SECTION ==================== */
.authorization-section {
  background: #fef3c7;
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid #fbbf24;
}

.auth-list {
  margin: 1rem 0 1.5rem;
  padding-left: 1.5rem;
}

.auth-list li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.consent-checkboxes {
  margin: 1.5rem 0;
  padding: 1rem;
  background: white;
  border-radius: 6px;
}

.consent-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  cursor: pointer;
}

.consent-item input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.consent-item span {
  font-size: 0.95rem;
  line-height: 1.6;
}

.signature-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: white;
  border-radius: 6px;
}

/* ==================== CONDITIONAL DISPLAY ==================== */
.conditional-form {
  display: none;
}

.conditional-form.active {
  display: block;
}

/* Role-based visibility */
.show-for-primary,
.show-for-dependent,
.show-for-other,
.show-for-provider {
  display: none;
}

/* When active, show the element with its natural display property */
.show-for-primary.role-visible,
.show-for-dependent.role-visible,
.show-for-other.role-visible,
.show-for-provider.role-visible {
  display: revert;
}

/* These will be toggled by JavaScript based on role */

/* ==================== CONFIRMATION ==================== */
.confirmation {
  display: none;
  padding: 3rem 2rem;
  text-align: center;
}

.confirmation.active {
  display: block;
}

.confirm-card {
  max-width: 600px;
  margin: 0 auto;
}

.checkmark {
  font-size: 4rem;
  color: var(--gold);
  margin-bottom: 1rem;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.confirm-card h2 {
  color: var(--navy);
  border: none;
  padding: 0;
  margin-bottom: 1rem;
}

.confirm-card p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--slate);
}

.confirm-desc {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .gl-header {
    padding: 1rem 0.75rem 0.875rem;
  }

  .gl-header .logo {
    font-size: 1.4rem;
  }

  .gl-header h1 {
    font-size: 1.15rem;
  }

  .gl-header .tagline {
    font-size: 0.85rem;
  }

  main.container {
    margin-top: 10.5rem;
  }

  .step {
    padding: 1.5rem 1rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  .form-grid,
  .device-grid,
  .social-platform-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: column;
  }

  button {
    width: 100%;
    padding: 0.875rem 1.5rem;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }

  .defense-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .gl-header .logo {
    font-size: 1.25rem;
  }

  .gl-header h1 {
    font-size: 1rem;
  }

  .progress {
    height: 8px;
  }

  .step-label {
    font-size: 0.8rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .notice-block {
    padding: 1rem;
  }
}

/* ==================== UTILITIES ==================== */
.hidden {
  display: none !important;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
