@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;0,700;1,400&family=Manrope:wght@300;400;500;600&display=swap');

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

:root {
  --green:       #1E6B4A;
  --green-dark:  #144D35;
  --green-mid:   #2A8A5E;
  --green-light: #E8F5EE;
  --green-pale:  #F2FAF6;
  --white:       #FFFFFF;
  --off:         #F7F8F6;
  --text:        #151A17;
  --text-2:      #4A5550;
  --text-3:      #8A9590;
  --border:      rgba(30,107,74,0.14);
  --border-inp:  #D4DDD9;
  --red:         #DC2626;
  --red-light:   #FEF2F2;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 2px 16px rgba(30,107,74,0.08);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--off);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
header {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 2rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; background: var(--green);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-name {
  font-family: 'Fraunces', serif; font-size: 1.3rem;
  font-weight: 700; color: var(--green-dark); letter-spacing: -0.02em;
}
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.link-muted { color: var(--text-2); font-size: 0.9rem; text-decoration: none; font-weight: 500; }
.link-muted:hover { color: var(--green); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.65rem 1.4rem; border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--text-3); cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1.5px solid var(--border-inp); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-full { width: 100%; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; border-radius: 10px; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.4rem;
}
.form-label .req { color: var(--green); margin-left: 2px; }
.form-hint { font-size: 0.78rem; color: var(--text-3); margin-top: 0.3rem; font-weight: 400; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.7rem 1rem;
  border: 1.5px solid var(--border-inp);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif; font-size: 0.95rem;
  color: var(--text); background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none; appearance: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30,107,74,0.1);
}
.form-input.error, .form-select.error { border-color: var(--red); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.1); }
.form-error { font-size: 0.78rem; color: var(--red); margin-top: 0.3rem; display: none; }
.form-error.visible { display: block; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231E6B4A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 2.5rem; cursor: pointer;
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.55; }

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

/* password toggle */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 2.75rem; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 4px; display: flex; align-items: center;
}
.pw-toggle:hover { color: var(--text-2); }

/* phone prefix */
.phone-wrap { display: flex; gap: 0; }
.phone-prefix {
  padding: 0.7rem 0.9rem; background: var(--off);
  border: 1.5px solid var(--border-inp); border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 0.9rem; color: var(--text-2); font-weight: 600;
  white-space: nowrap; display: flex; align-items: center; gap: 5px;
}
.phone-wrap .form-input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── CHECKBOX / RADIO ── */
.check-label {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: 0.88rem; color: var(--text-2);
  line-height: 1.5;
}
.check-label input[type="checkbox"],
.check-label input[type="radio"] { display: none; }
.check-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-inp); background: white;
  flex-shrink: 0; margin-top: 1px; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.check-label input[type="checkbox"]:checked ~ .check-box,
.check-label input[type="radio"]:checked ~ .check-box {
  background: var(--green); border-color: var(--green);
}
.check-box::after {
  content: ''; width: 9px; height: 5px;
  border-left: 2px solid white; border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
  transition: opacity 0.1s;
}
.check-label input[type="checkbox"]:checked ~ .check-box::after { opacity: 1; }

.radio-box {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border-inp); background: white;
  flex-shrink: 0; margin-top: 1px; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.check-label input[type="radio"]:checked ~ .radio-box {
  border-color: var(--green);
}
.radio-box::after {
  content: ''; width: 8px; height: 8px;
  background: var(--green); border-radius: 50%; opacity: 0; transition: opacity 0.1s;
}
.check-label input[type="radio"]:checked ~ .radio-box::after { opacity: 1; }

/* ── PROGRESS STEPS ── */
.steps-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 2.5rem;
}
.step-item {
  display: flex; align-items: center; gap: 0;
}
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border-inp);
  background: white; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--text-3);
  transition: all 0.3s; flex-shrink: 0; position: relative; z-index: 1;
}
.step-item.active .step-circle { border-color: var(--green); background: var(--green); color: white; }
.step-item.done .step-circle { border-color: var(--green); background: var(--green); color: white; }
.step-item.done .step-circle::after {
  content: '✓'; position: absolute; font-size: 0.85rem;
}
.step-item.done .step-circle span { display: none; }
.step-label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-3);
  margin-left: 8px; white-space: nowrap;
}
.step-item.active .step-label { color: var(--green); }
.step-item.done .step-label { color: var(--green); }
.step-line {
  height: 2px; width: 48px; background: var(--border-inp);
  transition: background 0.3s;
}
.step-line.done { background: var(--green); }

/* ── CARD LAYOUT ── */
.page-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: flex-start;
  justify-content: center; padding: 3rem 1.5rem 4rem;
}
.form-card {
  background: white; border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 100%; max-width: 560px;
  padding: 2.5rem 2.5rem;
  animation: card-in 0.35s ease both;
}
.form-card-wide { max-width: 720px; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-head { margin-bottom: 2rem; }
.card-head .eyebrow {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--green); margin-bottom: 0.4rem;
}
.card-head h1 {
  font-family: 'Fraunces', serif; font-size: 1.8rem;
  font-weight: 700; color: var(--text); letter-spacing: -0.03em; line-height: 1.2;
}
.card-head p { margin-top: 0.5rem; font-size: 0.9rem; color: var(--text-2); }

.divider {
  height: 1px; background: var(--border);
  margin: 1.5rem 0;
}
.or-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-3); font-size: 0.82rem; margin: 1.25rem 0;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── AVATAR UPLOAD ── */
.avatar-upload { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.avatar-preview {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--green-light); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: var(--green);
  overflow: hidden; flex-shrink: 0; position: relative;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-btn {
  background: var(--off); border: 1.5px solid var(--border-inp);
  color: var(--text-2); padding: 0.5rem 1rem;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-family: 'Manrope', sans-serif;
}
.avatar-upload-btn:hover { border-color: var(--green); color: var(--green); }
.avatar-hint { font-size: 0.75rem; color: var(--text-3); margin-top: 4px; }

/* ── TAGS SELECTOR ── */
.tags-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border-inp); background: white;
  font-size: 0.82rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.tag-chip:hover { border-color: var(--green); color: var(--green); }
.tag-chip.selected {
  background: var(--green-light); border-color: var(--green); color: var(--green);
}

/* ── SECTION WITHIN CARD ── */
.form-section { margin-bottom: 2rem; }
.form-section-title {
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  margin-bottom: 1rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* ── ALERT ── */
.alert {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.88rem; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 1.25rem;
}
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid rgba(30,107,74,0.2); }
.alert-error   { background: var(--red-light); color: var(--red); border: 1px solid rgba(220,38,38,0.2); }

/* ── PROFILE SIDEBAR LAYOUT (edit pages) ── */
.edit-layout {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 1.5rem; max-width: 960px; width: 100%;
}
.sidebar-nav {
  background: white; border-radius: 16px;
  border: 1px solid var(--border);
  padding: 1rem 0; height: fit-content;
  position: sticky; top: 80px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 0.65rem 1.25rem; text-decoration: none;
  font-size: 0.88rem; font-weight: 500; color: var(--text-2);
  transition: all 0.15s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { color: var(--green); background: var(--green-pale); }
.sidebar-nav a.active {
  color: var(--green); background: var(--green-pale);
  border-left-color: var(--green); font-weight: 600;
}
.sidebar-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }

.edit-main { display: flex; flex-direction: column; gap: 1.25rem; }
.edit-card {
  background: white; border-radius: 16px;
  border: 1px solid var(--border); padding: 2rem;
}
.edit-card-title {
  font-family: 'Fraunces', serif; font-size: 1.2rem;
  font-weight: 600; color: var(--text); margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.edit-actions {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  padding-top: 1.25rem; border-top: 1px solid var(--border);
}

/* ── BADGE ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-green { background: var(--green-light); color: var(--green); }
.badge-gray  { background: var(--off); color: var(--text-3); border: 1px solid var(--border-inp); }

/* ── RANGE SLIDER ── */
.range-row { display: flex; align-items: center; gap: 1rem; }
.range-row input[type="range"] { flex: 1; accent-color: var(--green); }
.range-val { font-weight: 700; color: var(--green); min-width: 56px; text-align: right; font-size: 0.95rem; }

/* ─── PROFILE AVATAR (header) ─── */
.profile-menu-wrap { position: relative; }
.profile-avatar-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-light); border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: var(--green);
  cursor: pointer; transition: all 0.15s;
  font-family: 'Manrope', sans-serif; position: relative;
}
.profile-avatar-btn:hover { background: var(--green); color: white; }
.profile-avatar-btn .online-dot {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; border: 2px solid white;
}
.profile-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: white; border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(30,107,74,0.12);
  min-width: 200px; overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.18s, transform 0.18s;
  z-index: 999;
}
.profile-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.profile-dropdown-header {
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.profile-dropdown-name { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.profile-dropdown-role { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.profile-dropdown a, .profile-dropdown button {
  display: flex; align-items: center; gap: 10px;
  padding: 0.65rem 1.1rem; font-size: 0.88rem; color: var(--text-2);
  text-decoration: none; width: 100%;
  background: none; border: none; cursor: pointer;
  font-family: 'Manrope', sans-serif; font-weight: 500;
  transition: background 0.12s, color 0.12s; text-align: left;
}
.profile-dropdown a:hover, .profile-dropdown button:hover {
  background: var(--green-pale); color: var(--green);
}
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.logout-btn { color: #dc2626 !important; }
.logout-btn:hover { background: #fef2f2 !important; color: #dc2626 !important; }
