/* ============================================================
   SFP Adviser Portal — Styles
   Palette: navy #0f1f35 | dark gold #b8952a | light gold #d4af5a
            beige #f5edd8 | warm white #faf8f3
   Fonts: Cormorant Garamond (display/italic) | DM Sans (UI)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */

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

:root {
  --navy:       #0f1f35;
  --navy-mid:   #162d4a;
  --navy-light: #1e3d5c;
  --gold-dark:  #b8952a;
  --gold-light: #d4af5a;
  --gold-pale:  #e8d49a;
  --beige:      #f5edd8;
  --warm-white: #faf8f3;
  --slate:      #5a6a7a;
  --slate-light:#8899aa;
  --muted:      #ccd4dc;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'DM Sans', sans-serif;

  --shadow-card: 0 2px 12px rgba(15,31,53,0.10), 0 1px 3px rgba(15,31,53,0.06);
  --shadow-hover: 0 8px 32px rgba(15,31,53,0.16), 0 2px 8px rgba(15,31,53,0.10);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: var(--font-ui);
  background: var(--warm-white);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Utility ──────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Login Screen ─────────────────────────────────────────── */

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

/* Subtle background texture: diagonal gold rules */
#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -55deg,
      transparent,
      transparent 80px,
      rgba(184,149,42,0.04) 80px,
      rgba(184,149,42,0.04) 81px
    );
  pointer-events: none;
}

/* Radial glow behind the card */
#login-screen::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(30,61,92,0.7) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--warm-white);
  width: 420px;
  max-width: calc(100vw - 2rem);
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.40),
    0 4px 16px rgba(0,0,0,0.20),
    inset 0 1px 0 rgba(255,255,255,0.8);
  animation: cardReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* Gold bar at top of card */
.login-card__bar {
  height: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
}

.login-card__body {
  padding: 2.5rem 2.75rem 2.75rem;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.login-logo__img {
  width: 148px;
  height: auto;
  display: block;
  border-radius: 6px;
  flex-shrink: 0;
}

.login-logo__sub {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
}

.login-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--beige), var(--muted), var(--beige));
  margin-bottom: 2rem;
}

.login-heading {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.75rem;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.login-subheading {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--slate);
  margin-bottom: 2.25rem;
  line-height: 1.5;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--navy);
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(212,175,90,0.08) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn-login:hover::before { transform: translateX(100%); }

.btn-login:hover {
  background: var(--navy-mid);
  color: var(--gold-pale);
  box-shadow: 0 4px 16px rgba(15,31,53,0.30);
}

.btn-login:active { transform: translateY(1px); }

.login-lock-icon {
  opacity: 0.7;
}

.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--beige);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-footer__text {
  font-size: 0.72rem;
  color: var(--slate-light);
  letter-spacing: 0.02em;
}

.login-footer__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

/* ── App Shell (post-login) ───────────────────────────────── */

#app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--warm-white);
}

/* ── Top Navigation ───────────────────────────────────────── */

.topnav {
  background: var(--navy);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* Gold underline rule */
.topnav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light) 40%, transparent);
}

.topnav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.topnav__logo-img {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 4px;
  flex-shrink: 0;
}

.topnav__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.topnav__firm {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--warm-white);
  letter-spacing: 0.01em;
}

.topnav__portal {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-top: 2px;
}

.topnav__spacer { flex: 1; }

.topnav__user {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topnav__user-info {
  text-align: right;
}

.topnav__user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--warm-white);
  display: block;
}

.topnav__user-role {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--slate-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-top: 1px;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: 1px solid rgba(212,175,90,0.35);
  border-radius: 2px;
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(212,175,90,0.10);
  border-color: var(--gold-light);
  color: var(--gold-pale);
}

/* ── Main Content ─────────────────────────────────────────── */

.main-content {
  flex: 1;
  padding: 3rem 2.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ── Welcome Section ─────────────────────────────────────── */

.welcome-section {
  margin-bottom: 3rem;
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

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

.welcome-date {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.6rem;
}

.welcome-heading {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.welcome-heading span {
  color: var(--gold-dark);
}

.welcome-subtext {
  font-size: 0.875rem;
  color: var(--slate);
  font-weight: 400;
  max-width: 480px;
  line-height: 1.6;
}

/* Section rule */
/* ── Dashboard sections ───────────────────────────────────── */

.dashboard-section {
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.dashboard-section + .dashboard-section {
  margin-top: 3.75rem;
}

.dashboard-section__heading {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.65rem;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.dashboard-section__rule {
  height: 1px;
  background: linear-gradient(90deg, rgba(184,149,42,0.45), var(--beige) 45%, transparent);
  margin-bottom: 1.5rem;
}

/* ── Tile Grid ────────────────────────────────────────────── */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* ── Tile brand accent overrides ──────────────────────────── */

/* SFP active tile: solid navy bar */
.tile--sfp.tile--active::before {
  background: var(--navy);
}

/* SWP active tile: dark green bar */
.tile--swp.tile--active::before {
  background: #0f2818;
}

/* ── Base Tile ────────────────────────────────────────────── */

.tile {
  background: white;
  border-radius: 4px;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(15,31,53,0.07);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

/* Left accent border (all tiles have the slot, colour varies) */
.tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
}

/* ── Active Tile ──────────────────────────────────────────── */

.tile--active {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.tile--active::before {
  background: linear-gradient(180deg, var(--gold-dark), var(--gold-light));
}

.tile--active:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(184,149,42,0.20);
}

.tile--active:hover .tile__arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* ── Placeholder Tile ─────────────────────────────────────── */

.tile--placeholder {
  background: var(--warm-white);
  cursor: default;
  border-color: rgba(15,31,53,0.05);
}

.tile--placeholder::before {
  background: var(--muted);
}

.tile--placeholder .tile__icon-wrap {
  background: var(--beige);
}

.tile--placeholder .tile__icon {
  opacity: 0.35;
}

.tile--placeholder .tile__title {
  color: var(--slate);
}

.tile--placeholder .tile__desc {
  color: var(--slate-light);
}

/* ── Tile Inner Elements ──────────────────────────────────── */

.tile__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25em 0.6em;
  border-radius: 100px;
}

.tile__badge--coming-soon {
  background: var(--beige);
  color: var(--slate);
}

.tile__badge--active {
  background: rgba(184,149,42,0.12);
  color: var(--gold-dark);
}

.tile__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: rgba(184,149,42,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.tile__icon {
  width: 22px;
  height: 22px;
  color: var(--gold-dark);
}

.tile__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.tile__desc {
  font-size: 0.78rem;
  color: var(--slate);
  line-height: 1.5;
  flex: 1;
}

.tile__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--beige);
}

.tile__action {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.tile--placeholder .tile__action {
  color: var(--muted);
}

.tile__arrow {
  transition: transform 0.22s ease, opacity 0.22s ease;
  opacity: 0.6;
  color: var(--gold-dark);
}

/* ── Page Footer ─────────────────────────────────────────── */

.page-footer {
  background: var(--navy);
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-footer__text {
  font-size: 0.68rem;
  color: var(--slate-light);
  letter-spacing: 0.04em;
}

.page-footer__reg {
  font-size: 0.65rem;
  color: rgba(90,106,122,0.7);
}

/* ── Shared back/cancel button ────────────────────────────── */

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: 1px solid rgba(15,31,53,0.18);
  color: var(--slate);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-back:hover {
  background: var(--beige);
  color: var(--navy);
}

/* ── Contacts CMS Layout ─────────────────────────────────── */

.cms-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--warm-white);
}

.cms-main {
  flex: 1;
  padding: 2rem 2.5rem 4rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.75rem;
  color: var(--slate-light);
  animation: fadeUp 0.3s cubic-bezier(0.22,1,0.36,1) both;
}

.breadcrumb-nav a {
  color: var(--slate);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb-nav a:hover { color: var(--gold-dark); }
.breadcrumb-nav span.sep { opacity: 0.4; }

/* Page header */
.cms-page-header {
  margin-bottom: 2rem;
  animation: fadeUp 0.4s cubic-bezier(0.22,1,0.36,1) 0.05s both;
}

.cms-page-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.cms-page-subtitle {
  font-size: 0.83rem;
  color: var(--slate);
  line-height: 1.5;
}

/* ── Toast notification ───────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  max-width: 380px;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: toastIn 0.3s cubic-bezier(0.22,1,0.36,1) both;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

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

.toast--error   { background: #2d0f0f; color: #f4b8b8; border-left: 3px solid #d45a5a; }
.toast--warning { background: #2d210f; color: #f4d8b8; border-left: 3px solid var(--gold-dark); }
.toast--success { background: #0f2d1a; color: #b8f4cc; border-left: 3px solid #3aaa5a; }

.toast__dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.toast__dismiss:hover { opacity: 1; }

/* ── Success panel ────────────────────────────────────────── */

.success-panel {
  background: white;
  border: 1px solid rgba(15,31,53,0.08);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 560px;
  margin: 0 auto 2rem;
  animation: fadeUp 0.4s cubic-bezier(0.22,1,0.36,1) both;
}

.success-panel__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(58,170,90,0.12);
  color: #3aaa5a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.25rem;
}

.success-panel__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.75rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.success-panel__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin-bottom: 0.5rem;
}

.success-panel__detail {
  font-size: 0.83rem;
  color: var(--slate);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.success-panel__ml-note {
  font-size: 0.78rem;
  color: var(--slate-light);
  margin-top: -1rem;
  margin-bottom: 1.75rem;
}

.success-panel__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Contact Form ─────────────────────────────────────────── */

.contact-form {
  animation: fadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}

/* ── Form Sections ────────────────────────────────────────── */

.form-section {
  background: white;
  border: 1px solid rgba(15,31,53,0.07);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.form-section__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  background: var(--navy);
  border-bottom: 2px solid rgba(184,149,42,0.3);
}

.form-section__icon {
  width: 16px;
  height: 16px;
  color: var(--gold-light);
  flex-shrink: 0;
  opacity: 0.85;
}

.form-section__title {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.form-section__body {
  padding: 1.5rem;
}

/* ── Field grids ──────────────────────────────────────────── */

.name-grid {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 1fr 110px;
  gap: 0.875rem;
}

.field-row {
  display: grid;
  gap: 0.875rem;
}

.field-row--2  { grid-template-columns: 1fr 1fr; }
.field-row--3  { grid-template-columns: 1fr 1fr 1fr; }
.field-row--1  { grid-template-columns: 1fr; }

.field-row + .field-row,
.name-grid + .field-row {
  margin-top: 0.875rem;
}

/* ── Individual field ─────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--slate);
}

.field label .req {
  color: var(--gold-dark);
  margin-left: 2px;
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--navy);
  background: var(--warm-white);
  border: 1px solid var(--muted);
  border-radius: 2px;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  width: 100%;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.field 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='%235a6a7a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(184,149,42,0.12);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--slate-light);
  opacity: 1;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.55;
}

/* ── Multi-entry rows (phones, emails, URLs) ──────────────── */

.entries-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.entries-count {
  font-size: 0.72rem;
  color: var(--slate-light);
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.entry-row {
  display: grid;
  grid-template-columns: 130px 1fr 40px;
  gap: 0.6rem;
  align-items: center;
}

.entry-row select,
.entry-row input {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--navy);
  background: var(--warm-white);
  border: 1px solid var(--muted);
  border-radius: 2px;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  width: 100%;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.entry-row 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='%235a6a7a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.entry-row select:focus,
.entry-row input:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(184,149,42,0.12);
}

.btn-remove-entry {
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(15,31,53,0.12);
  border-radius: 2px;
  color: var(--slate);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-remove-entry:hover {
  background: #fff0f0;
  border-color: #d45a5a;
  color: #d45a5a;
}

.btn-add-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.85rem;
  background: transparent;
  border: 1px dashed rgba(184,149,42,0.4);
  border-radius: 2px;
  color: var(--gold-dark);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-entry:hover {
  background: rgba(184,149,42,0.06);
  border-color: var(--gold-dark);
  color: var(--navy);
}

/* ── Address cards ────────────────────────────────────────── */

.address-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.address-card {
  border: 1px solid var(--beige);
  border-radius: 3px;
  overflow: hidden;
}

.address-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  background: var(--beige);
  border-bottom: 1px solid rgba(15,31,53,0.06);
}

.address-card__header select {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.04em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%230f1f35' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 1.25rem;
}

.address-card__header select:focus { outline: none; }

.address-card__header .spacer { flex: 1; }

.address-card__header .btn-remove-entry {
  width: 32px;
  height: 32px;
  border-color: rgba(15,31,53,0.15);
}

.address-card__fields {
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.address-card__fields input {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--navy);
  background: var(--warm-white);
  border: 1px solid var(--muted);
  border-radius: 2px;
  padding: 0.55rem 0.75rem;
  min-height: 44px;
  width: 100%;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.address-card__fields input:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(184,149,42,0.12);
}

.address-card__fields input::placeholder {
  color: var(--slate-light);
}

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

/* ── MailerLite / Distribution ────────────────────────────── */

.ml-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.ml-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.ml-toggle-row span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy);
}

.ml-groups-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--beige);
}

.ml-groups-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.875rem;
}

.ml-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.ml-group-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--beige);
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.ml-group-item:hover {
  background: rgba(184,149,42,0.05);
  border-color: rgba(184,149,42,0.25);
}

.ml-group-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.ml-group-item span {
  font-size: 0.82rem;
  color: var(--navy);
  line-height: 1.3;
}

.ml-email-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--slate);
  line-height: 1.4;
}

/* ── Form actions bar ─────────────────────────────────────── */

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--beige);
  flex-wrap: wrap;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: var(--navy);
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn-submit:hover:not(:disabled) {
  background: var(--navy-mid);
  color: var(--gold-pale);
  box-shadow: 0 4px 16px rgba(15,31,53,0.25);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner for loading state */
.btn-submit__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(212,175,90,0.3);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Dashboard responsive ─────────────────────────────────── */

@media (max-width: 1024px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .topnav { padding: 0 1rem; }
  .topnav__user-info { display: none; }
  .main-content { padding: 2rem 1rem; }
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 0.875rem; }
  .tile { min-height: 160px; padding: 1.25rem; }
  .page-footer { flex-direction: column; text-align: center; gap: 0.4rem; }
  .dashboard-section + .dashboard-section { margin-top: 2.75rem; }
  .dashboard-section__heading { font-size: 1.35rem; }
}

@media (max-width: 480px) {
  .tile-grid { grid-template-columns: 1fr; }
}

/* ── CMS responsive ───────────────────────────────────────── */

@media (max-width: 760px) {
  .cms-main { padding: 1.5rem 1rem 3rem; }

  .name-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* On small screens, push suffix after last name */
  .name-grid .field:nth-child(1) { order: 1; } /* Prefix */
  .name-grid .field:nth-child(2) { order: 2; grid-column: span 1; } /* First */
  .name-grid .field:nth-child(3) { order: 4; grid-column: span 2; } /* Middle - full width */
  .name-grid .field:nth-child(4) { order: 3; } /* Last */
  .name-grid .field:nth-child(5) { order: 5; grid-column: span 2; } /* Suffix - full width */

  .field-row--2,
  .field-row--3 {
    grid-template-columns: 1fr;
  }

  .entry-row {
    grid-template-columns: 110px 1fr 40px;
  }

  .addr-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn-submit,
  .form-actions .btn-back {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .ml-groups-grid {
    grid-template-columns: 1fr;
  }

  .success-panel__actions {
    flex-direction: column;
  }

  .success-panel__actions .btn-submit,
  .success-panel__actions .btn-back {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .entry-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    position: relative;
    padding-right: 50px;
  }

  .entry-row .btn-remove-entry {
    position: absolute;
    top: 0;
    right: 0;
    height: 44px;
  }

  .form-section__body { padding: 1rem; }
}
