/* ClearWaiver shared styles
   Uses CSS vars injected by _clearwaiver_layout.html from tenant_settings:
   --bg --primary --secondary --accent --text --muted
*/

:root {
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
  
    --panel: color-mix(in srgb, var(--text) 6%, transparent);
    --panel-2: color-mix(in srgb, var(--text) 7%, transparent);
    --border: color-mix(in srgb, var(--text) 10%, transparent);
    --border-2: color-mix(in srgb, var(--text) 14%, transparent);
  
    --shadow: 0 30px 80px rgba(0,0,0,0.45);
    --shadow-sm: 0 12px 30px rgba(0,0,0,0.35);
  
    --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  }
  
  * { box-sizing: border-box; }
  
  body {
    font-family: var(--font);
    margin: 0;
    color: var(--text);
  }
  
  /* ---------- Admin page shell ---------- */
  
  .admin-page {
    min-height: 100vh;
    background:
      radial-gradient(1000px 500px at 10% 10%,
        color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%),
      radial-gradient(1000px 500px at 90% 30%,
        color-mix(in srgb, var(--secondary) 18%, transparent), transparent 60%),
      linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, #000), var(--bg));
    padding: 40px 20px;
    color: var(--text);
  }
  @media (max-width: 640px) {
    .admin-page {
      padding: 0;
    }
  }
  
  .admin-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
  }
  
  /* header */
  .admin-header{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
  }
  
  .admin-title{
    margin: 0;
    font-size: 26px;
    letter-spacing: .2px;
  }
  
  .admin-subtitle{
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
  }
  
  .admin-header-actions{
    display:flex;
    gap: 10px;
    align-items: center;
  }
  
  /* ---------- Stats ---------- */
  
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 18px;
  }
  
  .stat-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
  }
  
  .stat-value {
    font-size: 24px;
    font-weight: 750;
    margin-top: 6px;
  }
  
  .actions-row {
    margin: 22px 0;
  }
  
  /* ---------- Panel + table ---------- */
  
  .panel{
    margin-top: 18px;
    background: color-mix(in srgb, var(--text) 5%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
  }
  
  .panel-head{
    display:flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }
  
  .panel-title{
    margin: 0;
    font-size: 16px;
  }
  
  .table-wrap{ overflow-x:auto; }
  
  .cw-table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .cw-table th {
    text-align: left;
    font-size: 12px;
    color: var(--muted);
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-2);
  }
  
  .cw-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  
  .cw-table tr:hover {
    background: color-mix(in srgb, var(--text) 4%, transparent);
  }
  
  .actions{ white-space: nowrap; }
  
  /* ---------- Typography helpers ---------- */
  
  .muted { color: var(--muted); font-size: 13px; }
  .small { font-size: 12px; }
  .row-title{ font-weight: 700; }
  .mono{
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
  }
  
  /* ---------- Pills ---------- */
  
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border-2);
    background: color-mix(in srgb, var(--text) 6%, transparent);
  }
  
  .pill-good {
    border-color: color-mix(in srgb, var(--secondary) 55%, transparent);
    color: color-mix(in srgb, var(--secondary) 90%, white 10%);
  }
  
  .pill-bad {
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    color: color-mix(in srgb, var(--accent) 90%, white 10%);
  }
  
  /* ---------- Buttons ---------- */
  
  .inline { display: inline-block; margin-left: 6px; }
  
  .btn, .primary-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
  }
  .user-info{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    width:100%;
    margin-bottom: 12px;
  }
  .user-info strong{
    margin-left: 12px;
    font-size: 20px;
    font-weight: 700;
  }
  .user-info a{
    margin-right: 12px;
  }

  .btn{
    border: 1px solid var(--border-2);
    background: color-mix(in srgb, var(--text) 6%, transparent);
    color: var(--text);
  }
  
  .btn:hover{ filter: brightness(1.05); }
  
  .btn-soft{
    background: color-mix(in srgb, var(--text) 7%, transparent);
  }
  
  .btn-good{
    border-color: color-mix(in srgb, var(--secondary) 55%, transparent);
    color: color-mix(in srgb, var(--secondary) 92%, white 10%);
  }
  
  .btn-danger{
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    color: color-mix(in srgb, var(--accent) 92%, white 10%);
  }
  
  .primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
  }
  
  .primary-btn:hover { filter: brightness(1.05); }
  
  /* ---------- Empty state ---------- */
  
  .empty-state{
    padding: 18px;
    border-radius: 12px;
    border: 1px dashed color-mix(in srgb, var(--text) 18%, transparent);
    color: var(--muted);
    text-align: center;
  }

/* ---------- Org Detail helpers ---------- */

.owner-row{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.owner-right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* details + form */
.cw-details{
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  padding: 10px 12px;
}

.cw-summary{
  cursor: pointer;
  font-weight: 700;
}

.cw-form{ margin-top: 12px; }

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field .label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.input{
  width: 100%;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: color-mix(in srgb, var(--bg) 75%, #000);
  color: var(--text);
}

.input::placeholder{
  color: color-mix(in srgb, var(--muted) 85%, transparent);
}

@media (max-width: 820px){
  .form-grid{ grid-template-columns: 1fr; }
  .owner-row{ flex-direction: column; align-items: flex-start; }
  .owner-right{ justify-content: flex-start; }
}

.cw-input{
  width: 100%;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}
.cw-input::placeholder{ color: color-mix(in srgb, var(--muted) 92%, transparent); }
.cw-input:focus{
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 65%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

.cw-input.textarea {
  min-height: 300px;
}



/* ---------- Public waiver (black/white/grey form) ---------- */

.public-wrap{
  max-width: 720px;
  margin: 0 auto;
}

.public-card.bw{
  background: #ffffff;
  color: #0b0f19;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.28);
}

.public-head{ margin-bottom: 14px; }
.public-title{
  margin: 0;
  font-size: 26px;
  letter-spacing: .2px;
}
.public-org{
  margin-top: 6px;
  color: rgba(11,15,25,0.65);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Public Waiver (Mobile-first fixes) ---------- */

.public-legal {
  margin: 16px 0 20px;
}

.public-legal-text {
  max-height: 220px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

/* Mobile: reduce dominance */
@media (max-width: 640px) {
  .public-legal-text {
    max-height: 160px;
    font-size: 13.5px;
  }
}
.public-legal-label{
  font-size: 12px;
  font-weight: 700;
  color: rgba(11,15,25,0.70);
  margin-bottom: 8px;
}


.public-form{ margin-top: 10px; }

/* iOS Safari date input fix */
.public-form input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;

  width: 100%;
  box-sizing: border-box;

  padding: 14px 16px;
  min-height: 48px;

  border-radius: 14px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;

  font-size: 16px; /* prevents iOS zoom */
}

.public-label{
  display: block;
  margin-top: 14px;
  font-weight: 700;
  font-size: 14px;
  color: rgba(11,15,25,0.85);
}

.public-input{
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #ffffff;
  color: #0b0f19;
  outline: none;
}

.public-textarea{ min-height: 92px; resize: vertical; }

.public-input:focus{
  border-color: rgba(0,0,0,0.35);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.08);
}

.public-check{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: rgba(11,15,25,0.85);
  font-size: 14px;
  font-weight: 600;
}

.public-submit{
  margin-top: 20px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.18);
  background: #0b0f19;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.public-submit:hover{ filter: brightness(1.05); }

.public-footer{
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: rgba(11,15,25,0.50);
}

@media (max-width: 520px){
  .public-card.bw{ padding: 18px; }
  .public-title{ font-size: 22px; }
}

.waiver-text{
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

/* =========================
   ClearWaiver Presentation Page
   (Sales support only)
   ========================= */

   .presentation-container {
    max-width: 980px;
  }
  
  /* Headline + subhead */
  
  .presentation-headline {
    margin: 0 0 10px 0;
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: 0.2px;
  }
  
  .presentation-subhead {
    max-width: 720px;
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 32px;
  }
  
  /* Screenshot grid */
  
  .presentation-screenshots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 36px;
  }
  
  .presentation-shot {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: var(--shadow-sm);
  }
  
  .presentation-shot img {
    width: 100%;
    display: block;
    border-radius: 10px;
  }
  
  /* List */
  
  .presentation-list {
    margin: 12px 0 36px 18px;
    font-size: 14px;
  }
  
  .presentation-list li {
    margin-bottom: 6px;
  }
  
  /* CTA */
  
  .presentation-cta {
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 14px;
  }
  
  /* Responsive */
  
  @media (min-width: 820px) {
    .presentation-screenshots {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .legal-card {
    max-width: 780px;
    margin: 40px auto;
    padding: 32px;
  }
  
  .legal-updated {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
  }
  
  .legal-card h2 {
    margin-top: 28px;
  }
  .legal-card a{
    color: var(--primary);
    text-decoration: none;
  }
  .legal-card a:hover{
    filter: brightness(1.2);
  }

  .cw-footer {
    position: fixed;
    bottom: 18px;
    left: 18px;
  
    font-size: 0.85rem;
    color: var(--muted);
  
    opacity: 0.75;
    transition: opacity 0.2s ease;
    z-index: 10;
  }
  
  .cw-footer:hover {
    opacity: 1;
  }
  
  .cw-footer a {
    color: var(--muted);
    text-decoration: none;
    margin-right: 10px;
  }
  
  .cw-footer a:hover {
    text-decoration: underline;
  }
  
  /* =========================
     Mobile override
     ========================= */
  @media (max-width: 640px) {
    .cw-footer {
      position: static;           /* re-enters document flow */
      margin: 32px auto 16px;
      text-align: center;
  
      opacity: 0.9;
    }
  
    .cw-footer a {
      margin: 0 8px;
    }
  }