/**
 * Edale Portal — Dashboard Styles
 *
 * Multi-page architecture: each portal section is its own WordPress page.
 * All colours, fonts, radii and transitions reference var(--edale-*) from tokens.css.
 * Do NOT hard-code brand values here.
 */

/* ═══════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */

.portal-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  margin-top: 72px;
  background: var(--edale-bg);
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE TOP BAR (hamburger, visible only on small screens)
   ═══════════════════════════════════════════════════════════════════════ */

.portal-mobile-bar {
  display: none; /* shown via media query */
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--edale-primary);
  z-index: 120;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.portal-mobile-bar__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

.portal-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: var(--edale-radius-sm);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--edale-transition-fast);
}

.portal-menu-btn:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════ */

.portal-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--edale-primary);
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px);
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.portal-sidebar__user {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}

.portal-sidebar__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--edale-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.portal-sidebar__name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.portal-sidebar__role {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR NAV
   ═══════════════════════════════════════════════════════════════════════ */

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.portal-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--edale-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: background var(--edale-transition-fast), color var(--edale-transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.portal-nav__item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  text-decoration: none;
}

.portal-nav__item.is-active {
  background: rgba(201,162,39,0.18);
  color: #fff;
  border-left: 3px solid var(--edale-accent);
  padding-left: 9px;
}

.portal-nav__item--soon {
  color: rgba(255,255,255,0.3);
  cursor: default;
  pointer-events: none;
}

.portal-nav__badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: var(--edale-accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--edale-radius-pill);
  letter-spacing: 0.04em;
}

/* ── Cashflow sub-navigation ──────────────────────────────────────────────
   Indented category links that expand under the Cashflow Planner item while
   that section is active. Each links to /portal/cashflow/?cf=<key>, which the
   page then uses to open the matching tab inside the planner. */
.portal-nav__subnav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
  margin: 2px 0 6px;
  padding-left: 24px;
}
.portal-nav__subnav::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 3px;
  bottom: 7px;
  width: 1px;
  background: rgba(255,255,255,0.13);
}
.portal-nav__subitem {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: var(--edale-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: background var(--edale-transition-fast), color var(--edale-transition-fast);
}
.portal-nav__subitem:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-decoration: none;
}
.portal-nav__subitem.is-active {
  background: rgba(201,162,39,0.14);
  color: #fff;
}
.portal-nav__subdot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: background var(--edale-transition-fast), box-shadow var(--edale-transition-fast);
}
.portal-nav__subitem:hover .portal-nav__subdot {
  background: rgba(255,255,255,0.7);
}
.portal-nav__subitem.is-active .portal-nav__subdot {
  background: var(--edale-accent);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.20);
}

.portal-nav__divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 12px 12px;
}

.portal-nav__logout {
  margin-top: auto;
  padding: 0 12px;
}

.portal-nav__logout a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--edale-radius-sm);
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color var(--edale-transition-fast);
}

.portal-nav__logout a:hover { color: rgba(255,255,255,0.75); }

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE OVERLAY
   ═══════════════════════════════════════════════════════════════════════ */

.portal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 119;
  backdrop-filter: blur(2px);
}

.portal-overlay.is-visible { display: block; }

/* ═══════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════ */

.portal-main {
  flex: 1;
  overflow-x: hidden;
  min-width: 0;
}

/* Full-bleed variant — no inner padding (used by cashflow iframe) */
.portal-main--full {
  display: flex;
  flex-direction: column;
}

/* ── Shared page content wrapper ──────────────────────────────────────── */

.portal-page-content {
  max-width: 100%;
  padding: 40px 40px 64px;
}

.portal-page-header {
  margin-bottom: 32px;
}

.portal-page-header__title {
  font-size: 26px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0 0 6px;
  font-family: var(--edale-font-heading);
}

.portal-page-header__sub {
  font-size: 15px;
  color: var(--edale-text-muted);
  margin: 0;
}

/* ── Card component ────────────────────────────────────────────────────── */

.portal-card {
  background: var(--edale-surface);
  border: 1px solid var(--edale-border-light);
  border-radius: var(--edale-radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.portal-card--highlight {
  border-color: var(--edale-accent);
  box-shadow: 0 0 0 1px rgba(201,162,39,0.15);
}

.portal-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0 0 16px;
  font-family: var(--edale-font-heading);
}

.portal-card__desc {
  font-size: 14px;
  color: var(--edale-text-muted);
  margin: -8px 0 20px;
  line-height: 1.6;
}

/* ── Alert component ───────────────────────────────────────────────────── */

.portal-alert {
  padding: 14px 18px;
  border-radius: var(--edale-radius-md);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.portal-alert--success {
  background: var(--edale-success-bg);
  border: 1px solid var(--edale-success-border);
  color: var(--edale-success);
}

.portal-alert--warning {
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #92400e;
}

.portal-alert--error {
  background: var(--edale-error-bg);
  border: 1px solid var(--edale-error-border);
  color: var(--edale-error);
}

/* ── Form components ───────────────────────────────────────────────────── */

.portal-form {}

.portal-form__row { margin-bottom: 18px; }

.portal-form__row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.portal-form__field { display: flex; flex-direction: column; gap: 6px; }

.portal-form__field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--edale-text-mid);
}

.portal-form__required { color: var(--edale-error); font-weight: 700; }
.portal-form__hint { font-size: 11.5px; color: var(--edale-text-muted); }

.portal-form__field input[type="text"],
.portal-form__field input[type="email"],
.portal-form__field input[type="tel"],
.portal-form__field input[type="password"],
.portal-form__field input[type="number"],
.portal-form__field select,
.portal-form__field textarea {
  padding: 10px 14px;
  border: 1px solid var(--edale-border);
  border-radius: var(--edale-radius-md);
  font-size: 14px;
  font-family: var(--edale-font-body);
  color: var(--edale-text);
  background: var(--edale-surface);
  transition: border-color var(--edale-transition-fast), box-shadow var(--edale-transition-fast);
  box-sizing: border-box;
  width: 100%;
}

.portal-form__field input:focus,
.portal-form__field select:focus,
.portal-form__field textarea:focus {
  outline: none;
  border-color: var(--edale-secondary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

.portal-form__field input:disabled,
.portal-form__field select:disabled {
  background: var(--edale-bg);
  color: var(--edale-text-muted);
  cursor: not-allowed;
}

.portal-form__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ── Button components ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--edale-radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--edale-font-body);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background var(--edale-transition-fast), border-color var(--edale-transition-fast), color var(--edale-transition-fast);
  line-height: 1.4;
}

.btn--primary {
  background: var(--edale-secondary);
  color: #fff;
}
.btn--primary:hover { background: #0D47A1; color: #fff; text-decoration: none; }

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--edale-border);
  color: var(--edale-text);
}
.btn--outline:hover { border-color: var(--edale-secondary); color: var(--edale-secondary); text-decoration: none; }

.btn--sm { padding: 7px 14px; font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════════════════ */

.portal-profile-meta { display: flex; flex-direction: column; gap: 0; }

.portal-profile-meta__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--edale-border-light);
  font-size: 14px;
}

.portal-profile-meta__row:last-child { border-bottom: none; }

.portal-profile-meta__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--edale-text-muted);
}

.portal-profile-meta__value { color: var(--edale-text); }
.portal-profile-meta__value--mono { font-family: monospace; font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════════════
   RISK PROFILER PAGE
   ═══════════════════════════════════════════════════════════════════════ */

.rp-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.rp-summary__item {
  background: var(--edale-bg);
  border: 1px solid var(--edale-border-light);
  border-radius: var(--edale-radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rp-summary__item--featured {
  grid-column: 1 / -1;
  background: rgba(201,162,39,0.06);
  border-color: rgba(201,162,39,0.3);
}

.rp-summary__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--edale-text-muted);
}

.rp-summary__value {
  font-size: 15px;
  font-weight: 600;
  color: var(--edale-text);
}

.rp-summary__value--strategy {
  font-size: 18px;
  color: var(--edale-primary);
  font-family: var(--edale-font-heading);
}

.rp-summary__value--mono { font-family: monospace; font-size: 13px; }

.rp-embed { margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════
   TABLE COMPONENT (amendment log, etc.)
   ═══════════════════════════════════════════════════════════════════════ */

.portal-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -32px;
  padding: 0 32px;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.portal-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--edale-text-muted);
  background: var(--edale-bg);
  border-bottom: 2px solid var(--edale-border-light);
  white-space: nowrap;
}

.portal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--edale-border-light);
  vertical-align: top;
  color: var(--edale-text);
}

.portal-table__row--current td {
  background: rgba(201,162,39,0.05);
  font-weight: 500;
}

.portal-table__code {
  font-family: monospace;
  font-size: 12px;
  background: var(--edale-bg);
  padding: 2px 6px;
  border-radius: var(--edale-radius-sm);
  border: 1px solid var(--edale-border-light);
}

.portal-table__notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--edale-text-muted);
  max-width: 220px;
}

.portal-table__reason {
  font-style: italic;
  display: block;
}

/* ── Badge component ───────────────────────────────────────────────────── */

.portal-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--edale-radius-pill);
}

.portal-badge--primary   { background: rgba(10,22,40,0.1);   color: var(--edale-primary); }
.portal-badge--secondary { background: rgba(21,101,192,0.1); color: var(--edale-secondary); }
.portal-badge--neutral   { background: var(--edale-bg);      color: var(--edale-text-muted); border: 1px solid var(--edale-border); }

/* ═══════════════════════════════════════════════════════════════════════
   WELCOME / OVERVIEW PAGE
   ═══════════════════════════════════════════════════════════════════════ */

.portal-welcome {
  max-width: 920px;
  padding: 48px 40px;
}

.portal-welcome__hero { margin-bottom: 40px; }

.portal-welcome__hero h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0 0 8px;
  font-family: var(--edale-font-heading);
}

.portal-welcome__hero p {
  font-size: 15px;
  color: var(--edale-text-muted);
  margin: 0;
}

.portal-welcome__section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}

/* Tools grid */
.portal-welcome__tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.portal-welcome__tool {
  background: var(--edale-surface);
  border: 1.5px solid var(--edale-border-light);
  border-radius: var(--edale-radius-lg);
  padding: 24px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--edale-transition-fast), box-shadow var(--edale-transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-welcome__tool:hover {
  border-color: var(--edale-accent);
  box-shadow: var(--edale-shadow-md);
  text-decoration: none;
}

.portal-welcome__tool--soon {
  cursor: default;
  opacity: 0.55;
  pointer-events: none;
}

.portal-welcome__tool-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 4px;
}

.portal-welcome__tool h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0;
  font-family: var(--edale-font-heading);
}

.portal-welcome__tool p {
  font-size: 13px;
  color: var(--edale-text-muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.portal-welcome__tool-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--edale-accent);
  margin-top: 4px;
}

/* How it works steps */
.portal-welcome__how { margin-bottom: 40px; }

.portal-welcome__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.portal-welcome__step {
  background: var(--edale-surface);
  border: 1px solid var(--edale-border-light);
  border-radius: var(--edale-radius-md);
  padding: 18px 16px;
}

.portal-welcome__step-num {
  width: 28px;
  height: 28px;
  background: var(--edale-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.portal-welcome__step h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--edale-text);
  margin: 0 0 6px;
  font-family: var(--edale-font-body);
}

.portal-welcome__step p {
  font-size: 12px;
  color: var(--edale-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Module grid */
.portal-welcome__modules { margin-bottom: 40px; }

.portal-welcome__module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.portal-welcome__module {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--edale-surface);
  border: 1px solid var(--edale-border-light);
  border-radius: var(--edale-radius-md);
  padding: 12px 14px;
}

.portal-welcome__module-icon { font-size: 18px; line-height: 1; flex-shrink: 0; margin-top: 2px; }

.portal-welcome__module h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--edale-text);
  margin: 0 0 3px;
  font-family: var(--edale-font-body);
}

.portal-welcome__module p {
  font-size: 11.5px;
  color: var(--edale-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Start CTA */
.portal-welcome__start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--edale-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--edale-radius-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--edale-transition-fast);
  cursor: pointer;
  border: none;
}

.portal-welcome__start:hover {
  background: #060d1a;
  color: #fff;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   COMING SOON PANEL
   ═══════════════════════════════════════════════════════════════════════ */

.portal-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 70vh;
  text-align: center;
  padding: 40px;
}

.portal-coming-soon__icon { font-size: 56px; margin-bottom: 20px; opacity: 0.3; }

.portal-coming-soon h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0 0 12px;
}

.portal-coming-soon p {
  font-size: 16px;
  color: var(--edale-text-muted);
  max-width: 440px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.portal-coming-soon__tag {
  display: inline-block;
  background: var(--edale-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--edale-radius-pill);
}

/* ═══════════════════════════════════════════════════════════════════════
   LOGIN / REGISTER PAGES
   ═══════════════════════════════════════════════════════════════════════ */

.portal-auth {
  min-height: calc(100vh - 72px);
  margin-top: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--edale-bg);
}

.portal-auth__card {
  background: var(--edale-surface);
  border-radius: var(--edale-radius-lg);
  box-shadow: var(--edale-shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.portal-auth__logo  { text-align: center; margin-bottom: 28px; }
.portal-auth__logo-img,
.portal-auth__logo img,
.portal-auth__logo .custom-logo { max-width: 200px; width: 100%; height: auto; display: inline-block; }

.portal-auth__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0 0 6px;
  text-align: center;
}

.portal-auth__subtitle {
  font-size: 14px;
  color: var(--edale-text-muted);
  text-align: center;
  margin: 0 0 28px;
}

.portal-auth__form .form-row { margin-bottom: 16px; }

.portal-auth__form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--edale-text-mid);
  margin-bottom: 6px;
}

.portal-auth__form input[type="text"],
.portal-auth__form input[type="email"],
.portal-auth__form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--edale-border);
  border-radius: var(--edale-radius-md);
  font-size: 14px;
  font-family: var(--edale-font-body);
  color: var(--edale-text);
  transition: border-color var(--edale-transition-fast), box-shadow var(--edale-transition-fast);
  box-sizing: border-box;
}

.portal-auth__form input:focus {
  outline: none;
  border-color: var(--edale-secondary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

.portal-auth__submit  { width: 100%; margin-top: 8px; }

.portal-auth__footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--edale-text-muted);
  text-align: center;
}

.portal-auth__footer a { color: var(--edale-secondary); text-decoration: underline; }

.portal-auth__message {
  padding: 12px 16px;
  border-radius: var(--edale-radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}

.portal-auth__message--error {
  background: var(--edale-error-bg);
  border: 1px solid var(--edale-error-border);
  color: var(--edale-error);
}

.portal-auth__message--success {
  background: var(--edale-success-bg);
  border: 1px solid var(--edale-success-border);
  color: var(--edale-success);
}

/* ── wp_login_form() normalisation ───────────────────────────────────── */
#edale-login-form p               { margin: 0 0 16px; }
#edale-login-form label           { display: block; font-size: 13px; font-weight: 600; color: var(--edale-text-mid); margin-bottom: 6px; }

#edale-login-form input[type="text"],
#edale-login-form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--edale-border);
  border-radius: var(--edale-radius-md);
  font-size: 14px;
  font-family: var(--edale-font-body);
  color: var(--edale-text);
  box-sizing: border-box;
  background: var(--edale-surface);
  transition: border-color var(--edale-transition-fast), box-shadow var(--edale-transition-fast);
}

#edale-login-form input[type="text"]:focus,
#edale-login-form input[type="password"]:focus {
  outline: none;
  border-color: var(--edale-secondary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

#edale-login-form .login-remember       { display: flex; align-items: center; gap: 8px; }
#edale-login-form .login-remember label { font-size: 13px; font-weight: 400; margin: 0; cursor: pointer; }
#edale-login-form .login-remember input { width: auto; margin: 0; }
#edale-login-form .login-submit         { margin: 0; padding: 0; }

#edale-login-form input[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--edale-secondary);
  color: #fff;
  border: none;
  border-radius: var(--edale-radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--edale-font-body);
  cursor: pointer;
  transition: background var(--edale-transition-fast);
}
#edale-login-form input[type="submit"]:hover { background: #0D47A1; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — ≤ 768px
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Mobile bar becomes visible */
  .portal-mobile-bar { display: flex; }

  /* Layout shifts down to accommodate mobile bar */
  .portal-layout {
    flex-direction: column;
    margin-top: 120px; /* 72px header + 48px mobile bar */
    min-height: calc(100vh - 120px);
  }

  .portal-auth {
    margin-top: 72px;
    min-height: calc(100vh - 72px);
  }

  /* Sidebar becomes fixed off-canvas drawer */
  .portal-sidebar {
    position: fixed;
    top: 120px;
    left: 0;
    width: 260px;
    height: calc(100vh - 120px);
    z-index: 130;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  .portal-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  }

  /* Prevent body scroll when sidebar open */
  body.portal-sidebar-open { overflow: hidden; }

  /* Main content fills full width */
  .portal-main { min-height: calc(100vh - 120px); }

  /* Page content padding adjustments */
  .portal-page-content { padding: 24px 20px 48px; }

  .portal-card { padding: 20px; }

  .portal-form__row--two { grid-template-columns: 1fr; }

  /* Welcome section */
  .portal-welcome { padding: 24px 20px; }
  .portal-welcome__tools { grid-template-columns: 1fr; }
  .portal-welcome__steps { grid-template-columns: 1fr 1fr; }
  .portal-welcome__module-grid { grid-template-columns: 1fr; }

  /* Table */
  .portal-table-wrap { margin: 0 -20px; padding: 0 20px; }

  /* Risk profiler summary */
  .rp-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .portal-welcome__steps { grid-template-columns: 1fr; }
  .portal-auth__card     { padding: 28px 20px; }
  .rp-summary            { grid-template-columns: 1fr; }
  .portal-page-header__title { font-size: 22px; }
}

/* ── Membership payment gate ──────────────────────────────────────────────── */
.portal-membership-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  margin: 40px auto 60px;
  padding: 48px 40px;
  background: #fff;
  border: 1px solid var(--edale-border, #e2e6ea);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.portal-membership-gate__icon {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1;
}

.portal-membership-gate__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--edale-primary);
  margin: 0 0 12px;
  font-family: var(--edale-font-heading);
}

.portal-membership-gate__body {
  font-size: 15px;
  color: var(--edale-text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

.portal-membership-gate__amount {
  font-size: 18px;
  font-weight: 600;
  color: var(--edale-primary);
  background: var(--edale-surface, #f4f6f8);
  padding: 12px 24px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.portal-membership-gate__btn {
  font-size: 16px;
  padding: 14px 32px;
  cursor: pointer;
}

.portal-membership-gate__note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--edale-text-muted);
  margin: 16px 0 0;
}

@media (max-width: 600px) {
  .portal-membership-gate {
    padding: 32px 20px;
  }
}
