/* ============================================================
   IMAAR ASSOCIATES — Premium Legal Platform
   Design System v2.0
   ============================================================ */

/* ── Fonts: self-hosted (assets/css/fonts.css) ────────────── */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  --navy:         #1A3C6E;
  --navy-dark:    #0D2147;
  --gold:         #C9A84C;
  --gold-dark:    #866a1c;   /* Session 11b: WCAG AA */
  --bg:           #F5F7FA;
  --bg2:          #EEF1F7;
  --white:        #FFFFFF;
  --text:         #1A1A2E;
  --text-mid:     #374151;
  --text-muted:   #6B7280;
  --text-light:   #9CA3AF;
  --border:       #E2E8F0;
  --border-dark:  #CBD5E1;
  --success:      #27AE60;
  --error:        #E74C3C;
  --error-bg:     #FDEDEC;
  --warning:      #F39C12;
  --warning-bg:   #FEF9E7;
  --info:         #2980B9;
  --info-bg:      #EBF5FB;
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --shadow-xs:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:    0 2px 8px rgba(26,60,110,.08), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md:    0 8px 28px rgba(26,60,110,.14), 0 4px 10px rgba(0,0,0,.08);
  --shadow-lg:    0 16px 48px rgba(26,60,110,.18), 0 6px 18px rgba(0,0,0,.10);
  --shadow-gold:  0 4px 20px rgba(201,168,76,.30);
  --transition:   .22s cubic-bezier(.4,0,.2,1);
  --navbar-h:     72px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--text); }

/* ── Page fade-in ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -700px 0; }
  100% { background-position: 700px 0; }
}
@keyframes progressFill {
  from { width: 0; } to { width: var(--progress-w); }
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}

/* Session 2: the page-wide fade-in (#main-content > * { animation: fadeInUp … both })
   was removed. It started every section at opacity 0, so pages looked blank
   until the stylesheet, fonts and animation had all run. Content now paints
   immediately. */

/* ── Layout Utilities ──────────────────────────────────────── */
.container    { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 780px;  margin: 0 auto; padding: 0 24px; }
.container-xs { max-width: 520px;  margin: 0 auto; padding: 0 24px; }
.section      { padding: 88px 0; }
/* flex helpers */
.flex-wrap { flex-wrap: wrap; }
/* text */
.text-muted   { color: var(--text-muted); }
.text-error   { color: var(--error); }
/* spacing */
.hidden{display:none!important}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  border: 2px solid transparent; transition: all var(--transition);
  white-space: nowrap; cursor: pointer; position: relative; overflow: hidden;
  letter-spacing: .01em; text-decoration: none;
}
.btn::after {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle, rgba(255,255,255,.25) 0%, transparent 70%);
  transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }

.btn-gold {
  background: var(--gold); color: var(--navy-dark); border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--navy-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,.4); }

.btn-outline {
  background: transparent; color: var(--navy); border-color: var(--border-dark);
}
.btn-outline:hover { background: var(--navy); color: #fff; border-color: var(--navy); transform: translateY(-1px); }

.btn-lg  { padding: 14px 32px; font-size: 15px; border-radius: var(--radius); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; transform: none !important; }

/* Loading button */
.btn-loading { color: transparent !important; pointer-events: none; }
.btn-loading::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
/* ── Forms — Floating Label ─────────────────────────────────── */
.form-group { margin-bottom: 22px; position: relative; }

.form-control {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border);
  border-radius: var(--radius); font-size: 14.5px; transition: all var(--transition);
  background: var(--white); color: var(--text); outline: none; appearance: none;
}
.form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,60,110,.10); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { min-height: 120px; resize: vertical; line-height: 1.7; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px;
}

/* Character counter */
.char-counter { font-size: 12px; color: var(--text-muted); }

/* ── Toast Notifications ────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius); min-width: 300px; max-width: 400px;
  box-shadow: var(--shadow-lg); pointer-events: all;
  animation: toastSlideIn .35s cubic-bezier(.34,1.56,.64,1) both;
  font-size: 14px; line-height: 1.5; border-left: 4px solid transparent;
}
.toast.toast-out { animation: toastSlideOut .3s ease both; }
.toast-success { background: #fff; border-left-color: var(--success); }
.toast-error   { background: #fff; border-left-color: var(--error); }
.toast-info    { background: #fff; border-left-color: var(--navy); }
.toast-warning { background: #fff; border-left-color: var(--warning); }
.toast-icon    { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--error); }
.toast-info    .toast-icon { color: var(--navy); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-body { flex: 1; }
.toast-title   { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.toast-message { color: var(--text-muted); font-size: 13px; }
.toast-close   { flex-shrink: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; color: var(--text-muted); font-size: 13px; transition: background var(--transition); }
.toast-close:hover { background: var(--bg); color: var(--text); }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 0 0 var(--radius) var(--radius); animation: progressFill 4s linear; }
.toast-success .toast-progress { background: var(--success); }
.toast-error   .toast-progress { background: var(--error); }
.toast-info    .toast-progress { background: var(--navy); }

/* ── Alerts (inline) ─────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px;
  border: 1px solid; font-size: 14px; display: flex; align-items: flex-start; gap: 10px;
}
.alert i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--error-bg);   border-color: #f5b7b1; color: #922b21; }
.flash-container { position: sticky; top: var(--navbar-h); z-index: 800; }
.flash-container .alert { border-radius: 0; margin: 0; border-left: none; border-right: none; border-top: none; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000; height: var(--navbar-h);
  background: var(--white); border-bottom: 1.5px solid var(--border);
  box-shadow: 0 2px 12px rgba(26,60,110,.06);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: 0 4px 20px rgba(26,60,110,.12); }
/* Notification bell */
.nav-bell { position: relative; }
.notif-dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 17px; height: 17px; background: var(--error); color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--white);
}

/* User dropdown */
.nav-user-wrap { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px;
  border-radius: 50px; border: 1.5px solid var(--border); background: none;
  cursor: pointer; transition: all var(--transition); font-size: 14px; color: var(--text); font-weight: 500;
}
.nav-user-btn:hover { border-color: var(--navy); background: var(--bg); }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }

.nav-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); min-width: 210px; z-index: 200; overflow: hidden;
  animation: fadeInUp .2s ease;
}
.nav-dropdown.open { display: block; }
.nav-dropdown a, .nav-dropdown button {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; font-size: 14px; color: var(--text-mid); width: 100%;
  transition: background var(--transition); background: none; border: none; cursor: pointer; text-align: left;
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: var(--bg); color: var(--navy); }
.nav-dropdown a i, .nav-dropdown button i { color: var(--text-muted); width: 16px; font-size: 14px; }
.nav-dropdown .sep { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.nav-dropdown .danger-link { color: var(--error) !important; }
.nav-dropdown .danger-link i { color: var(--error) !important; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 6px; cursor: pointer; background: none; border: none; }
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); display: block; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.mobile-nav {
  display: none; position: fixed; top: var(--navbar-h); left: 0; right: 0; bottom: 0;
  background: var(--white); z-index: 999; overflow-y: auto;
  padding: 20px 24px 40px; flex-direction: column; gap: 4px;
  border-top: 1.5px solid var(--border);
}
.mobile-nav.open { display: flex; animation: fadeInUp .25s ease; }
.mobile-nav a {
  padding: 13px 16px; font-size: 15px; font-weight: 500; color: var(--text);
  border-radius: var(--radius); display: flex; align-items: center; gap: 12px;
  transition: all var(--transition);
}
.mobile-nav a:hover { background: var(--bg); color: var(--navy); }
/* ── Legal Category Grid ─────────────────────────────────────── */
.cat-card {
  background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 18px 20px; text-align: center; cursor: pointer;
  transition: all var(--transition); display: flex; flex-direction: column; align-items: center;
  text-decoration: none;
}
.cat-card:hover {
  border-color: var(--navy); background: var(--navy); color: #fff;
  transform: translateY(-3px); box-shadow: var(--shadow-md);
}
.cat-card.selected { border-color: var(--navy); background: var(--navy); color: #fff; box-shadow: var(--shadow-md); }
/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; letter-spacing: .2px; }
/* ── Star Rating ─────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 2px; }
.star  { font-size: 14px; color: #ddd; }
/* Interactive star input */
.star-input { font-size: 28px; cursor: pointer; color: #e0e0e0; transition: color var(--transition); }
.star-input.active, .star-input:hover { color: var(--gold); }

/* ── Time Slots ──────────────────────────────────────────────── */
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.time-slot {
  padding: 10px 8px; border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer; text-align: center;
  transition: all var(--transition); color: var(--text-mid); background: var(--white);
}
.time-slot:hover:not(.booked) { border-color: var(--navy); color: var(--navy); background: rgba(26,60,110,.04); }
.time-slot.selected { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.time-slot.booked { background: var(--bg2); color: var(--text-light); cursor: not-allowed; text-decoration: line-through; opacity: .6; }

/* ── Calendar ────────────────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; cursor: pointer; transition: all var(--transition);
  border: 1px solid transparent; position: relative;
}
.cal-day:hover:not(.disabled):not(.empty) { background: rgba(26,60,110,.07); }
.cal-day.available { color: var(--success); font-weight: 700; }
.cal-day.available::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; background: var(--success); border-radius: 50%; }
.cal-day.selected { background: var(--navy) !important; color: #fff !important; border-radius: 50%; font-weight: 700; }
.cal-day.today { font-weight: 700; color: var(--navy); }
.cal-day.today::before { content: ''; position: absolute; inset: 3px; border: 2px solid var(--gold); border-radius: 50%; }
.cal-day.disabled { opacity: .3; cursor: not-allowed; }
.cal-day.empty { cursor: default; }

/* ── Payment Methods ─────────────────────────────────────────── */
.pay-method {
  border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 20px 16px;
  text-align: center; cursor: pointer; transition: all var(--transition); background: var(--white);
}
.pay-method:hover { border-color: var(--navy); background: rgba(26,60,110,.03); }
.pay-method.selected { border-color: var(--navy); background: rgba(26,60,110,.05); box-shadow: 0 0 0 3px rgba(26,60,110,.10); }
/* ── Data Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th { background: var(--navy); color: rgba(255,255,255,.9); padding: 13px 18px; text-align: left; font-weight: 600; font-size: 12px; white-space: nowrap; letter-spacing: .3px; text-transform: uppercase; }
.data-table thead th:first-child { border-radius: 0; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table td { padding: 14px 18px; vertical-align: middle; color: var(--text-mid); }
/* Status pills */
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 50px; font-size: 11.5px; font-weight: 700; }
.status::before { content: '●'; font-size: 7px; }
.s-confirmed  { background: #d5f5e3; color: #1e8449; }
.s-pending    { background: var(--warning-bg); color: #7d6608; }
.s-awaiting   { background: var(--info-bg); color: #154360; }
.s-cancelled  { background: var(--error-bg); color: #922b21; }
.s-completed  { background: #eafaf1; color: #145a32; }
.s-paid       { background: #d5f5e3; color: #1e8449; }
.s-refunded   { background: #f4ecf7; color: #6c3483; }
/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(13,33,71,.6);
  backdrop-filter: blur(4px); z-index: 2000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--white); border-radius: var(--radius-xl); max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: fadeInUp .25s ease;
}
/* ── Skeleton Loader ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg) 50%, var(--bg2) 75%);
  background-size: 700px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
}
/* ── Spinner ─────────────────────────────────────────────────── */
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
.spinner-sm { width: 20px; height: 20px; border-width: 2.5px; }
/* ── Footer ─────────────────────────────────────────────────── */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,.7); padding: 70px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 48px; margin-bottom: 56px; }
.footer-about p { font-size: 13.5px; line-height: 1.8; margin: 16px 0 22px; color: rgba(255,255,255,.55); }
.footer-col h4 { color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 18px; text-transform: uppercase; letter-spacing: .8px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255,255,255,.55); font-size: 13.5px; transition: color var(--transition); display: flex; align-items: center; gap: 7px; }
.footer-col ul li a:hover { color: var(--gold); }
.footer-col ul li a i { font-size: 12px; }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; font-size: 13.5px; color: rgba(255,255,255,.55); }
.footer-contact li i { color: var(--gold); font-size: 13px; margin-top: 2px; flex-shrink: 0; }
.footer-contact li a { color: rgba(255,255,255,.55); }
.footer-contact li a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 22px 0; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,.4); }
.footer-bottom a { color: rgba(255,255,255,.4); transition: color var(--transition); }
.footer-bottom a:hover { color: var(--gold); }
.footer-legal { display: flex; gap: 22px; }

/* ── Notification bell dropdown ──────────────────────────────── */
.notif-panel {
  display: none; position: absolute; top: calc(100% + 12px); right: 0;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 340px; z-index: 300; overflow: hidden;
}
.notif-panel.open { display: block; animation: fadeInUp .2s ease; }
.notif-panel-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-panel-head h4 { font-size: 14px; font-weight: 700; color: var(--navy); }
.notif-item { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; transition: background var(--transition); cursor: pointer; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(26,60,110,.03); }
.notif-item .notif-dot-sm { width: 8px; height: 8px; background: var(--navy); border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-item.unread .notif-dot-sm { background: var(--gold); }
.notif-item-body .notif-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notif-item-body .notif-msg   { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.notif-item-body .notif-time  { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  }
@media (max-width: 768px) {
  .hamburger  { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .footer-legal  { flex-wrap: wrap; justify-content: center; }
  .section  { padding: 60px 0; }
  }
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  #toast-container { right: 12px; bottom: 12px; }
  .toast { min-width: calc(100vw - 24px); }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .navbar, .site-footer, .btn, #toast-container { display: none !important; }
  body { background: #fff; }
}
