/* =========================================================
   Nestaura | signup.css — premium redesign
   Same JS hooks/IDs as before; visual layer rebuilt.
   ========================================================= */

:root {
  --teal: #004d40;
  --teal-dark: #00332b;
  --teal-soft: #e6efed;
  --brass: #a97c43;
  --brass-dark: #8c6435;
  --brass-soft: #f3e8d6;
  --cream: #f8f5ef;
  --white: #ffffff;
  --ink: #1f2a28;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --error: #c0392b;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 2px 14px rgba(0,0,0,0.06);
  --shadow-modal: 0 30px 80px -20px rgba(0,77,64,0.35);
  --transition: 0.3s cubic-bezier(.4,.2,.2,1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Raleway', sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

a { text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.pt-safe { padding-top: env(safe-area-inset-top); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- App topbar ---------- */
.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; max-width: 1200px; margin: 0 auto;
}
.app-topbar .brand-mark { display: flex; align-items: center; gap: 8px; }
.app-topbar .brand-mark img { height: 30px; }
.back-arrow {
  display: flex; align-items: center; gap: 6px;
  color: var(--teal); font-weight: 700; font-size: 0.88rem;
  transition: color var(--transition), transform var(--transition);
}
.back-arrow:hover { color: var(--brass-dark); }
.back-arrow svg { width: 20px; height: 20px; fill: currentColor; transition: transform var(--transition); }
.back-arrow:hover svg { transform: translateX(-3px); }

/* ---------- Chooser / hero ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 44px;
  min-height: calc(100vh - 62px);
  justify-content: center;
}
.intro { text-align: center; }
.intro .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brass-soft); color: var(--brass-dark);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 16px;
}
.intro h1 {
  margin: 0; font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700; color: var(--teal); letter-spacing: -0.01em;
}
.intro p {
  margin: 14px auto 0; font-size: 1rem; max-width: 620px;
  line-height: 1.6; color: var(--gray-500);
}

.roles {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .roles { grid-template-columns: 1fr 1fr; } }

.role-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--brass);
  transition: transform var(--transition), box-shadow var(--transition);
}
.role-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px -12px rgba(0,0,0,0.15); }
.role-card .role-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.role-card h2 { margin: 0; font-size: 1.15rem; color: var(--teal); font-weight: 700; }
.role-card p { flex: 1; margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--gray-500); }
.role-card button {
  margin-top: 6px;
  background: var(--teal);
  border: none; color: #fff;
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.88rem; letter-spacing: 0.02em;
  transition: background var(--transition);
}
.role-card button:hover { background: var(--teal-dark); }
.role-card button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.disclaimer { font-size: 0.78rem; color: var(--gray-500); text-align: center; max-width: 520px; margin: 0 auto; line-height: 1.5; }

/* =========================================================
   Modal / wizard
   Mobile: full-screen native "app" view.
   Desktop: centered split-panel premium card.
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: var(--cream);
  display: none;
}
.modal {
  position: relative;
  background: var(--white);
  width: 100%; height: 100%;
  max-width: none; max-height: none;
  border-radius: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: none;
}

.modal-inner {
  padding: 18px 20px calc(100px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}

.modal-appbar {
  position: sticky; top: 0; z-index: 3;
  background: var(--white);
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  padding-top: calc(14px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--gray-100);
}
.modal-close {
  background: var(--gray-100); border: none; color: var(--gray-500);
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--gray-200); }

.wizard-progress { display: flex; gap: 6px; flex: 1; }
.wizard-dot { flex: 1; height: 5px; border-radius: 999px; background: var(--gray-200); transition: background var(--transition); }
.wizard-dot.active { background: var(--brass); }
.wizard-dot.complete { background: var(--teal); }

.step-indicator {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gray-500); margin-bottom: 6px;
}
.back-link {
  background: none; border: none; color: var(--teal); font-weight: 700; font-size: 0.85rem;
  padding: 0; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 4px;
}
.back-link:hover { color: var(--brass-dark); }

.wizard-step { animation: fadeSlideIn 0.32s ease-out; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-step h2 { color: var(--teal); font-size: 1.25rem; font-weight: 700; line-height: 1.3; }

.role-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brass-soft); color: var(--brass-dark);
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 10px;
}

.subrole-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
@media (min-width: 460px) { .subrole-grid { grid-template-columns: 1fr 1fr; } }

.subrole-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
}
.subrole-card:hover, .subrole-card:focus-visible {
  border-color: var(--brass);
  background: var(--brass-soft);
  box-shadow: 0 10px 26px -10px rgba(169,124,67,0.35);
  transform: translateY(-2px);
  outline: none;
}
.subrole-card h4 { margin: 0 0 5px; font-size: 0.98rem; color: var(--teal); font-weight: 700; }
.subrole-card p { margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--gray-500); }

/* ---------- Form ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 6px; }
@media (min-width: 460px) { .form-grid { grid-template-columns: 1fr 1fr; } }

label {
  display: block; font-size: 0.72rem; font-weight: 700;
  margin-bottom: 6px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink);
}
.required-star { color: var(--error); margin-left: 2px; }

input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 0.94rem; background: var(--cream); color: var(--ink);
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); background: var(--white); }

input[type="file"] {
  padding: 9px 10px; font-size: 0.82rem; color: var(--gray-500);
}
input[type="file"]::file-selector-button {
  background: var(--teal); color: #fff; border: none;
  padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 0.78rem;
  margin-right: 10px; cursor: pointer; transition: background var(--transition);
}
input[type="file"]::file-selector-button:hover { background: var(--teal-dark); }

.password-input-container { position: relative; }
.password-toggle {
  position: absolute; right: 10px; top: 34px;
  background: none; border: none; color: var(--gray-500); font-size: 1rem;
}
.password-toggle:hover { color: var(--brass); }

.small { font-size: 0.82rem; color: var(--gray-500); line-height: 1.5; }
.field-hint { font-size: 0.76rem; color: var(--gray-500); margin-top: 4px; line-height: 1.4; }

.field-group { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-100); }
.field-group h3 { margin: 0 0 12px; font-size: 0.92rem; font-weight: 700; color: var(--teal); }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.checkbox-row input { width: auto; margin-top: 3px; accent-color: var(--teal); }
.checkbox-row label { display: inline; text-transform: none; font-weight: 400; margin: 0; font-size: 0.85rem; color: var(--ink); }

.legal-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.legal-links a { font-size: 0.78rem; color: var(--teal); font-weight: 700; }
.legal-links a:hover { color: var(--brass-dark); }

.error-message { color: var(--error); font-size: 0.82rem; margin-top: 5px; display: none; }
.error-message.show { display: block; }

/* ---------- Sticky step action / submit ---------- */
.step-actions {
  position: sticky; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--white) 65%, rgba(255,255,255,0));
  padding: 16px 0 4px;
  margin-top: 22px;
}
.submit-btn {
  width: 100%;
  background: var(--teal);
  border: none; padding: 15px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; transition: background var(--transition);
}
.submit-btn:hover { background: var(--teal-dark); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.role-tag-lg { font-size: 0.7rem; }

.links-row { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--gray-500); }

/* Decorative desktop-only rail — hidden by default so it (and its logo)
   never renders unstyled on mobile; the desktop media query below is what
   turns it into a flex column and sizes the logo. */
.modal-brand-rail { display: none; }
.links-row a { color: var(--teal); font-weight: 700; }
.links-row a:hover { color: var(--brass-dark); }

/* ---------- Messages / banners ---------- */
.modal-message {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--error); color: #fff; padding: 14px 20px; border-radius: var(--radius-sm);
  z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,0.2); font-size: 0.88rem; font-weight: 600;
  animation: fadeIn 0.25s ease-out; max-width: 90vw;
}
.modal-message.success { background: var(--teal); }
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

#verify-banner {
  z-index: 9999; font-family: 'Raleway', sans-serif; font-size: 15px; font-weight: 600;
}
#verify-banner.success { background-color: var(--teal); color: white; }
#verify-banner.error { background-color: var(--error); color: white; }
#verify-banner.info { background-color: #3B82F6; color: white; }
#verify-banner.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, -30px); }
#verify-banner.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   Desktop: split-panel premium card
   ========================================================= */
@media (min-width: 860px) {
  .modal-backdrop {
    align-items: center; justify-content: center;
    background: rgba(0, 51, 43, 0.55);
    padding: 40px 20px;
  }

  .modal {
    width: 100%; max-width: 960px; height: auto; max-height: 88vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    display: flex; overflow: hidden;
    animation: modalPop 0.35s cubic-bezier(.2,.9,.3,1.2);
  }
  @keyframes modalPop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

  .modal-brand-rail {
    display: flex; flex-direction: column; justify-content: space-between;
    width: 320px; flex-shrink: 0; padding: 40px 32px;
    background: linear-gradient(160deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff; position: relative; overflow: hidden;
  }
  .modal-brand-rail::after {
    content: ''; position: absolute; right: -60px; bottom: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(169,124,67,0.35), transparent 70%);
  }
  .modal-brand-rail img.logo { height: 34px; margin-bottom: 28px; }
  .modal-brand-rail .rail-title { font-size: 1.3rem; font-weight: 700; line-height: 1.35; margin-bottom: 14px; }
  .modal-brand-rail .rail-sub { font-size: 0.88rem; line-height: 1.6; color: rgba(255,255,255,0.75); }
  .modal-brand-rail .rail-points { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
  .modal-brand-rail .rail-points li { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: rgba(255,255,255,0.9); }
  .modal-brand-rail .rail-points svg { flex-shrink: 0; color: #e8c98f; }
  .modal-brand-rail .rail-foot { font-size: 0.72rem; color: rgba(255,255,255,0.5); position: relative; z-index: 1; }

  .modal-body-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .modal-appbar { padding: 18px 40px; padding-top: 18px; }
  .modal-close { position: static; }
  .modal-inner { padding: 24px 40px 40px; max-width: none; }
  .step-actions { background: linear-gradient(to top, var(--white) 80%, rgba(255,255,255,0)); }
  .submit-btn { width: auto; min-width: 220px; padding: 14px 28px; }
}

@media (max-width: 859px) {
  .app-topbar { display: none; }
  .page { padding: 0 20px; justify-content: center; }
}
