@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ===== VARIABLES ===== */
:root {
  --primary:       #1B4F72;
  --primary-light: #2E86C1;
  --primary-dark:  #154360;
  --accent:        #D4AC0D;
  --accent-light:  #F9E79F;
  --surface:       #FFFFFF;
  --surface-2:     #F4F6F8;
  --border:        #D5D8DC;
  --text:          #1C2833;
  --text-muted:    #626567;
  --error:         #C0392B;
  --error-bg:      #FDEDEC;
  --success:       #1E8449;
  --success-bg:    #EAFAF1;
  --warning:       #B7950B;
  --warning-bg:    #FEF9E7;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:     0 8px 28px rgba(0,0,0,0.10);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.12);
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    all 0.22s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface-2);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== BACKGROUND DECORATION ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(27,79,114,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(212,172,13,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== PAGE LAYOUT ===== */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* ===== BRAND HEADER ===== */
.brand {
  text-align: center;
  margin-bottom: 28px;
}
.brand-icon {
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(27,79,114,0.28);
}
.brand-icon svg { width: 28px; height: 28px; fill: white; }
.brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
}
.brand p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 300;
}

/* ===== CARD ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,0.9);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.card-wide {
  max-width: 680px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 28px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title:first-child { margin-top: 0; }
.section-title .badge {
  width: 22px; height: 22px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0 20px;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}
.form-group label .req {
  color: var(--error);
  margin-left: 2px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.12);
}
.form-group input.is-invalid,
.form-group select.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.10);
}
.form-group input.is-valid {
  border-color: var(--success);
}
.field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.field-error {
  font-size: 11.5px;
  color: var(--error);
  margin-top: 4px;
  display: none;
}
.field-error.visible { display: block; }

/* ===== FORM GRID ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27,79,114,0.28);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-primary:disabled {
  background: #AEB6BF;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 10px 18px;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

.btn-danger-sm {
  padding: 5px 10px;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger-sm:hover {
  background: var(--error-bg);
}

/* ===== ALERTS ===== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
  line-height: 1.5;
  border: 1px solid;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--error-bg);   color: var(--error);   border-color: #F1948A; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #82E0AA; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #F7DC6F; }

/* ===== LINKS ===== */
.text-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}
.text-link:hover { color: var(--primary-dark); text-decoration: underline; }

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ===== LOADER ===== */
.loader { display: none; text-align: center; margin-top: 14px; }
.spinner {
  width: 26px; height: 26px;
  border: 3px solid #D6EAF8;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== MEMBER CARD (onboarding) ===== */
.member-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  transition: var(--transition);
}
.member-card:hover { border-color: var(--primary-light); }
.member-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.member-card-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--primary-dark);
}

/* ===== FORGOT LINK ===== */
.forgot-row {
  text-align: right;
  margin-top: -8px;
  margin-bottom: 14px;
}
.forgot-row a { font-size: 12.5px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .card { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .brand h1 { font-size: 22px; }
}