/* ============================================================
   AECS MEMBER PORTAL — BASE.CSS
   Shared variables, reset, typography, utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --navy:        #0a1628;
  --navy-mid:    #0f2044;
  --navy-light:  #1a3360;
  --gold:        #c9a84c;
  --gold-light:  #e2c47a;
  --gold-pale:   #f5e9c8;
  --cream:       #faf8f3;
  --white:       #ffffff;
  --danger:      #e53e3e;
  --danger-light:#fff5f5;
  --success:     #2f855a;
  --success-light:#f0fff4;
  --warning:     #d69e2e;
  --warning-light:#fffbeb;
  --info:        #2b6cb0;
  --info-light:  #ebf8ff;
  --text-primary: #0a1628;
  --text-secondary: #4a5568;
  --text-muted:  #718096;
  --border:      #e2d9c5;
  --border-light:#f0ebe0;
  --shadow-sm:   0 1px 3px rgba(10,22,40,0.08);
  --shadow-md:   0 4px 16px rgba(10,22,40,0.12);
  --shadow-lg:   0 12px 40px rgba(10,22,40,0.18);
  --shadow-gold: 0 4px 20px rgba(201,168,76,0.25);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --font-display: 'Cinzel', serif;
  --font-body:    'Outfit', sans-serif;
  --transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── Typography ── */
.font-display { font-family: var(--font-display); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.02em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  transition: var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(10,22,40,0.2);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--navy-light), #264b8a);
  box-shadow: 0 4px 14px rgba(10,22,40,0.3);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light), #f0d080);
  box-shadow: 0 6px 20px rgba(201,168,76,0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--navy);
  background: var(--gold-pale);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) {
  background: #c53030;
  transform: translateY(-1px);
}

.btn-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 0.95rem; }
.btn-full { width: 100%; }

/* ── Form Elements ── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input-icon { position: relative; }
.form-input-icon .form-input { padding-right: 2.8rem; }
.form-input-icon .input-icon {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}
.form-input-icon .input-icon:hover { color: var(--navy); }
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.3rem;
  display: none;
}
.form-error.show { display: block; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-gold { background: var(--gold-pale); color: #7a5c1e; border: 1px solid #e2c47a; }
.badge-navy { background: #e8edf5; color: var(--navy); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-default { background: #f0f0f0; color: #555; }

/* ── Toast Notifications ── */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--gold);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.3s ease forwards;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-info    { border-left-color: var(--info); }
.toast.toast-out     { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; color: var(--text-primary); }
.toast-close {
  background: none; border: none; font-size: 1rem;
  color: var(--text-muted); cursor: pointer; padding: 0 0.2rem;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,22,40,0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0;
  background: var(--white);
  z-index: 1;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  letter-spacing: 0.03em;
}
.modal-close {
  background: none; border: none;
  font-size: 1.3rem; color: var(--text-muted);
  cursor: pointer; line-height: 1;
  transition: var(--transition);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.modal-close:hover { background: var(--border-light); color: var(--navy); }
.modal-body { padding: 1.5rem 1.75rem; }
.modal-footer {
  padding: 1rem 1.75rem 1.5rem;
  display: flex; gap: 0.75rem; justify-content: flex-end;
}

/* ── Loading Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-navy {
  border-color: rgba(10,22,40,0.2);
  border-top-color: var(--navy);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-muted); font-size: 0.8rem; font-weight: 500;
  margin: 1rem 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Utility ── */
.hidden    { display: none !important; }
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: 0.82rem; }
.privacy-blur { filter: blur(6px); user-select: none; transition: filter 0.3s; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--border-light); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-light); }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

/* ── Page Loader ── */
#page-loader {
  position: fixed; inset: 0;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1rem;
  z-index: 99999;
  transition: opacity 0.4s ease;
}
#page-loader.fade-out,
#page-loader.out { opacity: 0; visibility: hidden; pointer-events: none; }
#page-loader .loader-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}
#page-loader .loader-bar {
  width: 120px; height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
}
#page-loader .loader-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  animation: loadBar 1.2s ease forwards;
}
@keyframes loadBar {
  from { width: 0; }
  to   { width: 100%; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin-top: auto; max-height: 95vh; }
  .modal-backdrop { align-items: flex-end; }
}
