/* ════════════════════════════════════════════════════════════════
   WAVES SUBMISSIONS — SHARED DESIGN SYSTEM
   Matches the existing WCC Exam Portal palette/typography exactly.
════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600;700&display=swap');

:root{
  --navy:        #0f2449;
  --navy-dark:   #081630;
  --navy-dim:    #1a3660;
  --gold:        #c8942a;
  --gold-pale:   #e8b84b;
  --gold-light:  #fdf3dc;
  --off-white:   #f5f8ff;
  --bg:          #eef2f9;
  --text:        #1a2a4a;
  --text-light:  #6b7896;
  --white:       #ffffff;
  --border:      #dde4f0;
  --success:     #1e7e42;
  --success-bg:  #e9f6ee;
  --warn:        #92400e;
  --warn-bg:     #fdf3dc;
  --danger:      #b3261e;
  --danger-bg:   #fbeceb;

  --font-display: 'Cormorant Garamond', serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'IBM Plex Mono', 'SF Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(15,36,73,0.06);
  --shadow-md: 0 8px 28px rgba(15,36,73,0.10);
  --shadow-lg: 0 20px 60px rgba(15,36,73,0.16);
  --radius: 14px;
}

*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%;}
body{
  font-family: var(--font-body);
  background:
    radial-gradient(900px circle at -8% -12%, rgba(15,36,73,0.05), transparent 55%),
    radial-gradient(900px circle at 108% 18%, rgba(15,36,73,0.04), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img{max-width:100%; display:block;}
button{font-family: inherit; cursor:pointer;}
input, textarea{font-family: inherit;}
a{color: inherit;}

::-webkit-scrollbar{width:8px; height:8px;}
::-webkit-scrollbar-thumb{background: rgba(15,36,73,0.18); border-radius: 8px;}

.hidden{display:none !important;}
.sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0);}

/* ── Layout shells ───────────────────────────────────────────── */
.app-shell{min-height:100vh; display:flex; flex-direction:column;}
.container{max-width: 760px; margin:0 auto; width:100%; padding: 0 20px;}
.container-wide{max-width: 1220px; margin:0 auto; width:100%; padding: 0 24px;}
@media (min-width:640px){ .container{padding: 0 24px;} }

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar{
  background: var(--navy-dark);
  color: #fff;
  padding: 18px 0;
  position: sticky; top:0; z-index: 40;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar-inner{display:flex; align-items:center; justify-content:space-between; gap:16px;}
.brand{display:flex; align-items:center; gap:11px;}
.brand-mark{
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-pale), var(--gold));
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-display); font-weight:700; color: var(--navy-dark); font-size: 18px;
  flex-shrink:0;
}
.brand-text{display:flex; flex-direction:column; line-height:1.15;}
.brand-name{font-family: var(--font-display); font-weight:700; font-size:17.5px; color:#fff; letter-spacing:0.01em;}
.brand-sub{font-size:10px; letter-spacing:0.14em; text-transform:uppercase; color: var(--gold-pale); font-weight:600;}
.topbar-right{display:flex; align-items:center; gap:6px; font-size:13.5px; color: rgba(255,255,255,0.65);}
.topbar-user{font-weight:600; color:#fff; font-size:15px;}
.link-btn{
  position:relative; background:none; border:none; color: rgba(255,255,255,0.62); font-size:13.5px; font-weight:600;
  letter-spacing:0.01em; padding:9px 12px; border-radius:8px; transition: color .15s ease, background-color .15s ease;
}
.link-btn::after{
  content:''; position:absolute; left:12px; right:12px; bottom:4px; height:2px; border-radius:2px;
  background: var(--gold-pale); transform: scaleX(0); transform-origin:center; transition: transform .18s ease;
}
.link-btn:hover{color:#fff; background: rgba(255,255,255,0.06);}
.link-btn:hover::after{transform: scaleX(1);}

/* ── Cards / surfaces ────────────────────────────────────────── */
.card{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad{padding: 22px;}
.section-label{
  font-size: 12px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  color: var(--text-light); margin-bottom: 14px;
}
.page-title{font-family: var(--font-display); font-weight:700; font-size: clamp(1.7rem, 3.4vw, 2.4rem); color: var(--navy); line-height:1.15;}
.page-sub{color: var(--text-light); font-size:14.5px; margin-top:6px;}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 13px 22px; border-radius: 10px; border:1px solid var(--border);
  background: var(--white); color: var(--navy); font-size:14px; font-weight:600;
  transition: all .15s ease; white-space:nowrap;
}
.btn:hover{border-color: var(--navy-dim); box-shadow: var(--shadow-sm);}
.btn:disabled{opacity:.45; cursor:not-allowed; box-shadow:none;}
.btn-primary{background: var(--navy); border-color: var(--navy); color:#fff;}
.btn-primary:hover{background: var(--navy-dark); border-color: var(--navy-dark);}
.btn-gold{
  background: linear-gradient(135deg, var(--gold-pale), var(--gold)); border-color: var(--gold); color: var(--navy-dark); font-weight:700;
  box-shadow: 0 4px 14px rgba(200,148,42,0.3);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, border-color .16s ease;
}
.btn-gold:hover{filter:brightness(1.05); box-shadow: 0 8px 24px rgba(200,148,42,0.4); transform: translateY(-1px);}
.btn-gold:active{transform: translateY(0) scale(0.97);}
.btn-danger{background: var(--danger-bg); border-color: rgba(179,38,30,0.25); color: var(--danger);}
.btn-danger:hover{background: #f6dad8;}
.btn-full{width:100%;}
.btn-sm{padding: 8px 14px; font-size:12.5px; border-radius:8px;}
.btn-icon{width:40px; height:40px; padding:0; border-radius:10px;}
.btn svg{width:16px; height:16px; flex-shrink:0;}

/* ── Forms ───────────────────────────────────────────────────── */
.field{margin-bottom:16px;}
.field label{display:block; font-size:12.5px; font-weight:600; color: var(--text); margin-bottom:7px;}
.input, textarea.input{
  width:100%; padding: 13px 14px; border:1px solid var(--border); border-radius:10px;
  background: var(--off-white); font-size:15px; color: var(--text);
}
.input:focus, textarea.input:focus{outline:none; border-color: var(--navy-dim); background:#fff; box-shadow:0 0 0 3px rgba(15,36,73,0.07);}
textarea.input{resize: vertical; min-height:90px; font-family:inherit;}

/* ── Status pills ────────────────────────────────────────────── */
.pill{
  display:inline-flex; align-items:center; gap:6px; padding: 5px 12px; border-radius:100px;
  font-size:11.5px; font-weight:700; letter-spacing:0.02em;
}
.pill::before{content:''; width:6px; height:6px; border-radius:50%; background:currentColor;}
.pill-pending{background: var(--warn-bg); color: var(--warn);}
.pill-approved{background: var(--success-bg); color: var(--success);}
.pill-returned{background: var(--danger-bg); color: var(--danger);}
.pill-auto{background: #eef2f9; color: var(--text-light);}

/* ── Empty state ─────────────────────────────────────────────── */
.empty{text-align:center; padding: 48px 20px; color: var(--text-light);}
.empty svg{width:38px; height:38px; margin:0 auto 14px; opacity:.35;}
.empty-title{font-family: var(--font-display); font-weight:600; font-size:18px; color: var(--navy); margin-bottom:6px;}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-stack{position:fixed; bottom:20px; left:0; right:0; z-index:200; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; padding:0 16px;}
.toast{
  background: var(--navy-dark); color:#fff; padding:12px 20px; border-radius:10px; font-size:13.5px; font-weight:500;
  box-shadow: var(--shadow-lg); max-width: 420px; text-align:center; opacity:0; transform: translateY(8px);
  transition: all .25s ease; pointer-events:auto;
}
.toast.show{opacity:1; transform: translateY(0);}
.toast.error{background: var(--danger);}
.toast.success{background: var(--success);}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay{
  position:fixed; inset:0; background: rgba(8,22,48,0.55); backdrop-filter: blur(2px);
  display:flex; align-items:flex-end; justify-content:center; z-index:150; padding:0;
}
@media (min-width:640px){ .modal-overlay{align-items:center; padding:20px;} }
.modal{
  background:#fff; width:100%; max-width:460px; border-radius: 18px 18px 0 0; padding:26px 22px 22px;
  max-height: 88vh; overflow-y:auto; box-shadow: var(--shadow-lg);
}
@media (min-width:640px){ .modal{border-radius:16px;} }
.modal-title{font-family: var(--font-display); font-weight:700; font-size:1.4rem; color: var(--navy); margin-bottom:8px;}
.modal-body{color: var(--text-light); font-size:14px; margin-bottom:20px; line-height:1.6;}
.modal-actions{display:flex; gap:10px;}
.modal-actions .btn{flex:1;}

/* ── Loading ─────────────────────────────────────────────────── */
.spinner{
  width:20px; height:20px; border-radius:50%;
  border: 2.5px solid rgba(15,36,73,0.15); border-top-color: var(--navy);
  animation: spin .7s linear infinite;
}
.spinner.light{border-color: rgba(255,255,255,0.25); border-top-color:#fff;}
@keyframes spin{to{transform:rotate(360deg);}}
.skeleton{background: linear-gradient(90deg, #e9edf6 25%, #f3f6fb 37%, #e9edf6 63%); background-size:400% 100%; animation: shimmer 1.4s ease infinite; border-radius:8px;}
@keyframes shimmer{0%{background-position:100% 0;} 100%{background-position:0 0;}}

/* ── Bottom nav (mobile) ─────────────────────────────────────── */
.bottom-bar{
  position: sticky; bottom:0; background:#fff; border-top:1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display:flex; gap:10px; z-index: 60;
}

/* ── Utility ─────────────────────────────────────────────────── */
.flex{display:flex;}
.flex-col{display:flex; flex-direction:column;}
.items-center{align-items:center;}
.justify-between{justify-content:space-between;}
.gap-8{gap:8px;} .gap-12{gap:12px;} .gap-16{gap:16px;}
.mt-8{margin-top:8px;} .mt-12{margin-top:12px;} .mt-16{margin-top:16px;} .mt-24{margin-top:24px;} .mt-32{margin-top:32px;}
.mb-8{margin-bottom:8px;} .mb-12{margin-bottom:12px;} .mb-16{margin-bottom:16px;}
.text-light{color: var(--text-light);}
.text-sm{font-size:13px;}
.text-center{text-align:center;}
.divider{height:1px; background: var(--border); margin: 18px 0;}
