/* ============================================================
   MATRIMONIAL PROFILE CREATION – Improved UI
   Font: Playfair Display + DM Sans
   ============================================================ */

:root {
  --teal-primary:  #27d6c5;
  --teal-deep:     #0d9488;
  --teal-light:    #e0faf7;
  --teal-mid:      #5eead4;
  --purple:        #7c3aed;
  --purple-mid:    #a78bfa;
  --purple-light:  #ede9fe;
  --purple-deep:   #5b21b6;
  --gold:          #f59e0b;
  --gold-light:    #fef3c7;
  --green:         #16a34a;
  --green-light:   #dcfce7;
  --red-light:     #fef2f2;
  --text-dark:     #1a2e2b;
  --text-mid:      #3d5652;
  --text-muted:    #6b8c87;
  --border-color:  #d1e8e4;
  --input-border:  #c8d8d5;
  --card-bg:       #ffffff;
  --page-bg:       #f0faf8;
  --radius:        14px;
  --radius-sm:     8px;
  --shadow-sm:     0 2px 10px rgba(13,148,136,0.08);
  --shadow-md:     0 6px 28px rgba(13,148,136,0.14);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text-dark);
}

/* ============================================================
   ERROR / LOGIN PROMPT
   ============================================================ */
.error-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 1rem;
}

.error-icon {
  width: 72px; height: 72px;
  background: var(--teal-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--teal-deep);
  margin-bottom: 0.5rem;
}

.error-container h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--text-dark);
  margin: 0;
}

.error-container p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

.error-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-primary  { background: linear-gradient(135deg, var(--teal-primary), var(--teal-deep)); color: #fff; }
.btn-secondary { background: var(--teal-light); color: var(--teal-deep); border: 1.5px solid var(--teal-mid); }
.btn-primary:hover, .btn-secondary:hover { opacity: 0.88; transform: translateY(-1px); }

/* ============================================================
   HERO / LANDING SECTION
   ============================================================ */
.profile {
  width: 100%;
  min-height: 60vh;
  background: linear-gradient(135deg, #1fb6a8 0%, #6d28d9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 2rem 4rem;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  margin-top: 0rem;
}

/* Dot texture */
.profile::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.p-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 3rem;
  max-width: 1000px;
  width: 100%;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  margin-top: 2rem;
}

/* ── Left: illustration ── */
.p-l {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 340px;
}

.p-l-img-wrap {
  width: 100%;
  border-radius: 0 48px 0 48px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
  border: 2px solid rgba(255,255,255,0.3);
}

.p-l img {
  width: 100%;
  display: block;
  border-radius: 0;
  min-height: 220px;
  object-fit: cover;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.95);
  color: var(--teal-deep);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: 24px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: transform 0.2s, box-shadow 0.2s;
}

.search-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

/* ── Right: info card ── */
.profile-content {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem 2rem 2.2rem;
  width: 380px;
  max-width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  border: 1.5px solid rgba(255,255,255,0.4);
}

.profile-content-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--purple-deep);
  background: var(--purple-light);
  border: 1px solid var(--purple-mid);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.welcome-line {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 0.3rem;
}

.welcome-line strong { color: var(--text-dark); }

.profile-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  color: var(--text-dark);
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.25;
  border-left: none;
  padding-left: 0;
}

.sub-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 1.4rem;
  line-height: 1.6;
}

/* Step preview dots */
.step-preview {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.6rem;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 54px;
}

.step-dot i {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: #aaa;
  transition: background 0.2s;
}

.step-dot.active-dot i { background: var(--teal-light); color: var(--teal-deep); }

.step-line {
  flex: 1;
  height: 2px;
  background: #e0e0e0;
  margin-bottom: 18px;
}

/* Start button */
.button-profile {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 11px 26px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
  transition: opacity 0.2s, transform 0.2s;
  width: 100%;
  justify-content: center;
}

.button-profile:hover { opacity: 0.88; transform: translateY(-1px); }

/* ============================================================
   MULTI-STEP FORM
   ============================================================ */
#regForm {
  display: none;
  flex-direction: column;
  background: var(--card-bg);
  max-width: 680px;
  width: 92%;
  margin: 3rem auto 4rem;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--border-color);
  overflow: hidden;
}

/* Form header + step bar */
.form-header {
  background: linear-gradient(135deg, var(--teal-deep), var(--purple-deep));
  padding: 1.8rem 2rem 1.4rem;
}

.form-title {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.3rem;
  text-align: center;
}

/* Step progress bar */
.step-bar {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}

.step-bar-item.active { color: #fff; }
.step-bar-item.done   { color: rgba(255,255,255,0.8); }

.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.step-bar-item.active .step-circle {
  background: rgba(255,255,255,0.95);
  border-color: #fff;
  color: var(--teal-deep);
}

.step-bar-item.done .step-circle {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

.step-bar-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.2);
  margin-bottom: 22px;
  max-width: 40px;
}

/* ── Tabs ── */
.tab {
  display: none;
  padding: 2rem 2rem 1rem;
  flex-direction: column;
}

.tab-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  padding-bottom: 0.9rem;
  border-bottom: 1.5px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-section-title i {
  width: 34px; height: 34px;
  background: var(--teal-light);
  color: var(--teal-deep);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Field groups ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 1.2rem;
}

.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}

.fields-row .field-group { margin-bottom: 1.2rem; }

label {
  color: var(--text-mid);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* Inputs */
input[type="text"],
input[type="file"],
select,
textarea {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: #fff;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: unset;
  box-sizing: border-box;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-deep);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}

input.invalid {
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225,29,72,0.1);
}

select { height: 42px; cursor: pointer; }

textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

/* Char counter */
.char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Radio pills */
input[type="radio"] { display: none; }

.radio-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

input[type="radio"] + label {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid var(--border-color);
  color: var(--text-mid);
  background: #fff;
  border-radius: 20px;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  margin: 0;
  letter-spacing: 0;
}

input[type="radio"]:checked + label {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: #fff;
}

/* Submit section */
.submit-group { margin-top: 0.5rem; }

.submit-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1rem;
}

.save_submit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  justify-content: center;
  padding: 13px 0;
  background: linear-gradient(135deg, var(--teal-primary), var(--teal-deep));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13,148,136,0.35);
  transition: opacity 0.2s, transform 0.2s;
}

.save_submit:hover { opacity: 0.88; transform: translateY(-1px); }

/* Nav buttons row */
.form-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.form-nav-last {
  justify-content: flex-start;
  border-top: none;
  padding-top: 0;
  margin-top: -0.5rem;
}

.btn-prev, .btn-next {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-prev {
  background: var(--teal-light);
  color: var(--teal-deep);
  border: 1.5px solid var(--teal-mid);
}

.btn-next {
  background: linear-gradient(135deg, var(--teal-primary), var(--teal-deep));
  color: #fff;
  box-shadow: 0 3px 10px rgba(13,148,136,0.3);
}

.btn-prev:hover, .btn-next:hover { opacity: 0.88; transform: translateY(-1px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media screen and (max-width: 830px) {
  .profile { padding: 6rem 1rem 3rem; }

  .p-inner { flex-direction: column; gap: 2rem; }

  .p-l { width: 100%; max-width: 400px; }

  .profile-content { width: 100%; max-width: 420px; }

  #regForm { width: 96%; margin: 2rem auto 3rem; }

  .form-header { padding: 1.4rem 1.2rem 1.2rem; }

  .tab { padding: 1.5rem 1.2rem 0.8rem; }
}

@media screen and (max-width: 600px) {
  .fields-row { grid-template-columns: 1fr; }

  .step-bar-item span { display: none; }

  .step-bar-line { max-width: 20px; }

  #regForm { width: 97%; border-radius: 14px; }
}

@media screen and (max-width: 500px) {
  .profile { padding-top: 5rem; }
}