/* static/style.css */

/* ===== Design tokens ===== */
:root{
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f2f5f8;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.10);

  --accent: #40A77E;         /* Benman green */
  --accent-2: #2f8b69;
  --accent-soft: rgba(64, 167, 126, 0.14);

  --shadow: 0 16px 45px rgba(2, 8, 23, 0.10);
  --shadow-soft: 0 10px 30px rgba(2, 8, 23, 0.08);

  --radius: 18px;
  --radius-sm: 12px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(64,167,126,0.20), transparent 55%),
    radial-gradient(1000px 550px at 90% 0%, rgba(64,167,126,0.10), transparent 60%),
    var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.35;
}

/* ===== Layout ===== */
.container{
  width:min(1100px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar{
  position: sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(10px);
  background: rgba(246, 248, 251, 0.75);
  border-bottom: 1px solid var(--border);
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 220px;
}

.brand img{
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(2, 8, 23, 0.08);
  padding: 6px;
}

.brand .title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}
.brand .title strong{
  font-size: 14px;
  letter-spacing: 0.2px;
}
.brand .title span{
  font-size: 12px;
  color: var(--muted);
}

/* ===== Buttons ===== */
.btn{
  appearance:none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 650;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease;
  box-shadow: 0 10px 22px rgba(2, 8, 23, 0.06);
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 35px rgba(2, 8, 23, 0.10);
  border-color: rgba(64,167,126,0.35);
}

.btn:active{ transform: translateY(0); }

.btn-primary{
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color:#fff;
  border-color: transparent;
}

.btn-primary:hover{
  border-color: transparent;
  box-shadow: 0 18px 45px rgba(64,167,126,0.25);
}

.btn-ghost{
  background: transparent;
  box-shadow:none;
}

.btn-ghost:hover{
  background: rgba(255,255,255,0.6);
  box-shadow: 0 10px 25px rgba(2, 8, 23, 0.06);
}

.btn:disabled{
  opacity:0.55;
  cursor:not-allowed;
  transform:none;
}

/* ===== Main hero ===== */
.hero{
  margin: 26px 0 18px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 18px;
}

.hero h1{
  margin:0;
  font-size: 28px;
  letter-spacing:-0.4px;
}

.hero p{
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 65ch;
}

.badges{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.badge{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.06);
}

.dot{
  width:9px; height:9px;
  border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(64,167,126,0.14);
}

/* ===== Grid/cards ===== */
.grid{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  padding-bottom: 28px;
}

@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  .badges{ justify-content:flex-start; }
}

.card{
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow:hidden;
}

.card-header{
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
}

.card-title{
  margin:0;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.card-subtitle{
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.card-body{
  padding: 16px;
}

.kpi{
  display:flex;
  gap: 12px;
  flex-wrap:wrap;
}

.kpi .pill{
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(64,167,126,0.10);
  border: 1px solid rgba(64,167,126,0.22);
  color: #0f3d2e;
  font-size: 12px;
  font-weight: 650;
}

/* ===== Forms ===== */
.field{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin: 12px 0;
}

label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

select, input[type="email"], input[type="password"], input[type="text"]{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  outline:none;
  transition: border-color .12s ease, box-shadow .12s ease;
}

select:focus, input:focus{
  border-color: rgba(64,167,126,0.5);
  box-shadow: 0 0 0 6px rgba(64,167,126,0.12);
}

.filebox{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px dashed rgba(15, 23, 42, 0.20);
  background: rgba(255,255,255,0.65);
}

.filebox strong{
  font-size: 13px;
}

.filebox span{
  color: var(--muted);
  font-size: 12px;
}

input[type="file"]{
  width: 100%;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
}

.actions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top: 12px;
}

.hr{
  height:1px;
  background: var(--border);
  margin: 14px 0;
}

/* ===== Flash messages ===== */
.flash-wrap{
  margin: 14px 0 0;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.flash{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.80);
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.06);
}

.flash .icon{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
}

.flash .msg{
  font-size: 13px;
  color: var(--text);
}

.flash.success{ border-color: rgba(64,167,126,0.35); background: rgba(64,167,126,0.10); }
.flash.success .icon{ background: var(--accent); box-shadow: 0 0 0 6px rgba(64,167,126,0.12); }

.flash.error{ border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.08); }
.flash.error .icon{ background: #ef4444; box-shadow: 0 0 0 6px rgba(239,68,68,0.12); }

.flash.info{ border-color: rgba(59,130,246,0.30); background: rgba(59,130,246,0.08); }
.flash.info .icon{ background: #3b82f6; box-shadow: 0 0 0 6px rgba(59,130,246,0.12); }

.small-link{
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}
.small-link:hover{ text-decoration: underline; }

/* ===== Auth pages ===== */
.auth{
  min-height: calc(100vh - 74px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 0 40px;
}

.auth-card{
  width: min(520px, 100%);
}

.footer{
  padding: 22px 0 30px;
  color: var(--muted);
  font-size: 12px;
}
.footer .row{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
}
















/* ===== Global Loading Overlay ===== */
.loading-overlay{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  padding: 16px;
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(64,167,126,.22), transparent 55%),
    radial-gradient(800px 460px at 110% 10%, rgba(64,167,126,.14), transparent 45%),
    rgba(2, 6, 23, .72);
  backdrop-filter: blur(10px);
}
.loading-overlay.show{ display:flex; align-items:center; justify-content:center; }

.loading-card{
  width: min(720px, calc(100% - 16px));
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
  padding: 18px;
  position: relative;
}

.loading-top{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.loading-brand{ display:flex; align-items:center; gap:12px; }
.loading-mark{
  width: 44px; height: 44px; border-radius: 16px;
  background: rgba(64,167,126,.18);
  border: 1px solid rgba(64,167,126,.35);
  position: relative;
  overflow: hidden;
}
.loading-mark::before{
  content:"";
  position:absolute; inset:-40%;
  background: conic-gradient(from 180deg, rgba(64,167,126,0), rgba(64,167,126,.75), rgba(64,167,126,0));
  animation: spin 1.3s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg);} }

.loading-title{ font-weight: 900; font-size: 16px; color: #e7eefc; }
.loading-sub{ margin-top: 2px; font-size: 13px; color: rgba(231,238,252,.72); }

.loading-chip{
  font-size: 12px;
  color: rgba(231,238,252,.85);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  padding: 8px 10px;
  border-radius: 999px;
}

.loading-steps{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 14px;
}
.step{
  display:flex; align-items:center; gap:8px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(231,238,252,.78);
}
.step .dot{
  width: 9px; height: 9px; border-radius: 999px;
  background: rgba(148,163,184,.8);
}
.step.active{
  border-color: rgba(64,167,126,.35);
  background: rgba(64,167,126,.12);
  color: #e7eefc;
}
.step.active .dot{ background: #40A77E; box-shadow: 0 0 0 6px rgba(64,167,126,.14); }
.step.done .dot{ background: rgba(64,167,126,.65); }

.progress{
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  margin-top: 14px;
}
.progress .bar{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(64,167,126,.25), rgba(64,167,126,.9));
  border-radius: 999px;
  transition: width .25s ease;
}

.loading-hint{
  margin-top: 12px;
  font-size: 12.5px;
  color: rgba(231,238,252,.72);
}

.loading-min{
  margin-top: 14px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(231,238,252,.9);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}
.loading-min:hover{ border-color: rgba(64,167,126,.35); }

.loading-fab{
  display:none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10001;
  border: 1px solid rgba(64,167,126,.35);
  background: rgba(64,167,126,.18);
  color: #e7eefc;
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 18px 55px rgba(0,0,0,.45);
}

.loading-overlay.minimized{
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
.loading-overlay.minimized .loading-fab{
  pointer-events: auto;
}



.box-disabled {
  opacity: 0.45;
  filter: grayscale(100%);
  pointer-events: none; /* blocks clicks */
  user-select: none;
}

.box-disabled .overlay-lock {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #666;
}

.box-wrapper {
  position: relative;
}


  /* Force vote card to stay under CV (right column) */
  #voteCard{
    grid-column: 2 / 3;
  }

  /* Mobile: grid becomes 1 column => vote should take full width */
  @media (max-width: 900px){
    #voteCard{
      grid-column: 1 / -1;
    }
  }

  .voteBtn{
    border:1px solid rgba(15,26,46,.14);
    background:rgba(15,26,46,.04);
    padding:10px 12px;
    border-radius:14px;
    cursor:pointer;
    font-weight:900;
    transition: transform .08s ease, background .12s ease;
  }
  .voteBtn:hover{ transform: translateY(-1px); background:rgba(15,26,46,.07); }
  .voteBtn:active{ transform: translateY(0px) scale(.98); }
  .voteBtn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }
