/* ============================================================
   Aliplast Download Portal — Stylesheet
   Vanilla CSS, no framework, mobile-first
   ============================================================ */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary:     #1a3a5c;
  --color-primary-dk:  #122840;
  --color-accent:      #2e7d32;
  --color-danger:      #c62828;
  --color-warning:     #e65100;
  --color-bg:          #f4f6f8;
  --color-card:        #ffffff;
  --color-border:      #d0d7de;
  --color-text:        #24292f;
  --color-muted:       #57606a;
  --color-success:     #2e7d32;
  --radius:            6px;
  --shadow:            0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --font:              -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

.main-content {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 40px;
}

/* --- Header --- */
.site-header {
  background: var(--color-primary);
  color: #fff;
  padding: 14px 0;
  border-bottom: 3px solid var(--color-primary-dk);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .03em;
}

.site-tagline {
  font-size: .85rem;
  opacity: .8;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,.6);
  padding: 12px 0;
  font-size: .8rem;
  text-align: center;
  margin-top: auto;
}

.footer-guide-link {
  color: rgba(255,255,255,.6);
  text-decoration: underline;
}

/* --- Card --- */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.card-center { text-align: center; }

.card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.card-subtitle {
  color: var(--color-muted);
  margin-bottom: 24px;
  font-size: .95rem;
}

/* --- Forms --- */
.request-form { margin-top: 8px; }

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 6px;
  color: var(--color-text);
}

.optional {
  font-weight: 400;
  color: var(--color-muted);
  font-size: .85em;
}

.required-mark {
  color: var(--color-danger);
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--color-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.12);
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: .82rem;
  color: var(--color-muted);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-actions { margin-top: 28px; }

.privacy-notice {
  margin-top: 16px;
  font-size: .8rem;
  color: var(--color-muted);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  line-height: 1.4;
}

.btn:active { transform: translateY(1px); }

.btn-primary  { background: var(--color-primary); color: #fff; }
.btn-primary:hover  { opacity: .88; }

.btn-secondary { background: #e8edf1; color: var(--color-text); }
.btn-secondary:hover { background: #d8e0e8; }

.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { opacity: .88; }

.btn-download { background: var(--color-accent); color: #fff; white-space: nowrap; }
.btn-download:hover { opacity: .88; }

/* --- Status icons --- */
.status-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}
.status-pending  { color: #e65100; }
.status-rejected { color: var(--color-danger); }
.status-error    { color: var(--color-warning); }
.status-success  { color: var(--color-success); }

/* --- Info box --- */
.info-box {
  background: #e8f0fe;
  border: 1px solid #b3c6f7;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: .9rem;
  text-align: left;
}

.info-box ul {
  margin-top: 8px;
  padding-left: 20px;
}

.info-box li { margin-bottom: 4px; }

/* --- Session banner --- */
.session-banner {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: .9rem;
  color: #1b5e20;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-icon { font-size: 1.1rem; }

#session-timer {
  font-weight: 700;
  font-family: monospace;
  font-size: 1rem;
}

/* --- Folder sections --- */
.folder-section {
  margin-bottom: 28px;
}

.folder-section:last-of-type { margin-bottom: 0; }

.folder-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-icon { font-size: 1.15rem; }

/* --- File list --- */
.file-list {
  list-style: none;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  gap: 16px;
  transition: background .1s;
}

.file-item:last-child { border-bottom: none; }
.file-item:hover { background: #f6f8fa; }

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.file-meta-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  font-size: .95rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: .78rem;
  color: var(--color-muted);
  font-family: monospace;
}

/* --- Risk badge on file list --- */
.risk-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.risk-high   { background: #fce4e4; color: #b71c1c; border: 1px solid #ef9a9a; }
.risk-medium { background: #fff8e1; color: #e65100; border: 1px solid #ffcc80; }

/* --- Warning page --- */
.warning-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.warning-high   { background: #fce4e4; border: 2px solid #e53935; color: #b71c1c; }
.warning-medium { background: #fff8e1; border: 2px solid #fb8c00; color: #e65100; }

.warning-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }

.warning-body {
  margin-bottom: 20px;
  line-height: 1.7;
}
.warning-body p { margin-bottom: 10px; }

.warning-list {
  margin: 10px 0 0 20px;
}
.warning-list li { margin-bottom: 4px; }

.warning-confirm {
  border-top: 2px dashed #e53935;
  padding-top: 20px;
  margin-top: 8px;
}

.warning-legal {
  font-size: .875rem;
  color: var(--color-muted);
  background: #f6f8fa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.warning-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-warning-confirm {
  background: #c62828;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-warning-confirm:hover { opacity: .88; }

/* --- Empty state --- */
.empty-state {
  color: var(--color-muted);
  text-align: center;
  padding: 24px 0;
}

/* --- Logout area --- */
.logout-area {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: right;
}

/* --- Misc --- */
.muted { color: var(--color-muted); font-size: .9rem; }

/* --- Utility --- */
.hidden { display: none !important; }

/* --- Status polling states --- */
.btn-large { padding: 14px 36px; font-size: 1.1rem; margin-top: 8px; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; animation: spin 1.2s linear infinite; }

.poll-status { color: var(--color-muted); font-size: .85rem; margin-top: 8px; }

/* --- Responsive --- */
@media (max-width: 520px) {
  .card { padding: 20px 16px; }
  .file-item { flex-direction: column; align-items: flex-start; }
  .btn-download { width: 100%; text-align: center; }
}

/* ============================================================
   Handleiding (end-user guide) styles
   ============================================================ */

.guide-wrap { max-width: 800px; margin: 0 auto; }

.guide-hero {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  text-align: center;
}

.guide-hero h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.guide-hero p  { opacity: .88; margin-bottom: 20px; }

.guide-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.guide-nav-btn {
  display: inline-block;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: var(--radius);
  padding: 10px 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s;
}
.guide-nav-btn:hover { background: rgba(255,255,255,.25); }

/* Section wrapper */
.guide-section {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 28px;
}
.guide-section-alt { background: #f8f9ff; }

.guide-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
}

.guide-section-intro {
  color: var(--color-muted);
  margin-bottom: 24px;
  font-size: .95rem;
}

/* Steps */
.guide-steps { display: flex; flex-direction: column; gap: 28px; }

.guide-step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step-content { flex: 1; min-width: 0; }
.step-content h3 { font-size: 1.05rem; color: var(--color-text); margin-bottom: 8px; }
.step-content p  { margin-bottom: 8px; font-size: .95rem; }
.step-content ul { margin: 8px 0 8px 20px; font-size: .95rem; }
.step-content li { margin-bottom: 4px; }

/* Browser mockup */
.guide-screen {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 12px 0;
  background: #fff;
}

.screen-bar {
  background: #e8edf1;
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.screen-bar span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0c8d0;
}
.screen-bar span:first-child  { background: #fc5f57; }
.screen-bar span:nth-child(2) { background: #fdbc2c; }
.screen-bar span:nth-child(3) { background: #33c748; }

.screen-body {
  padding: 16px;
  font-size: .85rem;
}

.screen-waiting {
  text-align: center;
  padding: 24px;
  color: var(--color-muted);
}

.screen-approved {
  text-align: center;
  padding: 24px;
}

/* Mock form elements */
.mock-form { display: flex; flex-direction: column; gap: 8px; }
.mock-field { display: flex; flex-direction: column; gap: 3px; }
.mock-label { font-size: .8rem; font-weight: 600; color: var(--color-text); }
.mock-opt   { font-weight: 400; color: var(--color-muted); font-size: .78em; }
.mock-req   { color: var(--color-danger); }
.mock-input { height: 26px; background: #f6f8fa; border: 1px solid var(--color-border); border-radius: 3px; }
.mock-textarea { height: 42px; }
.mock-select {
  height: 26px;
  background: #f6f8fa;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-muted);
  padding: 0 6px;
  line-height: 26px;
  font-size: .8rem;
}
.mock-required .mock-select { border-color: #1a3a5c; }
.mock-btn {
  margin-top: 6px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
}

/* Mock states */
.mock-spinner { font-size: 2rem; animation: spin 1.2s linear infinite; display: inline-block; margin-bottom: 8px; }
.mock-title   { font-weight: 700; font-size: 1rem; color: var(--color-text); }
.mock-sub     { font-size: .8rem; color: var(--color-muted); margin-top: 4px; }
.mock-check   { font-size: 2.5rem; color: var(--color-success); display: block; margin-bottom: 8px; }
.mock-dl-btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: .9rem;
  font-weight: 700;
  margin: 8px 0;
}

.mock-session-bar {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: .8rem;
  color: #1b5e20;
  margin-bottom: 10px;
}

.mock-folder { border: 1px solid var(--color-border); border-radius: 4px; overflow: hidden; }
.mock-folder-title {
  background: #f0f3f6;
  padding: 6px 10px;
  font-weight: 700;
  font-size: .82rem;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
}
.mock-file-row {
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  border-bottom: 1px solid #f0f0f0;
}
.mock-file-row:last-child { border-bottom: none; }
.mock-badge-red {
  display: inline-block;
  background: #fce4e4;
  color: #b71c1c;
  border: 1px solid #ef9a9a;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 5px;
  margin-left: 6px;
}
.mock-dl-small { color: var(--color-accent); font-weight: 700; white-space: nowrap; }

.mock-warning-header {
  background: #fce4e4;
  border: 1px solid #e53935;
  border-radius: 4px;
  padding: 10px 12px;
  color: #b71c1c;
  font-size: .85rem;
  margin-bottom: 8px;
}
.mock-warning-text { font-size: .82rem; color: var(--color-muted); margin-bottom: 8px; }
.mock-warning-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mock-btn-cancel  { font-size: .82rem; color: var(--color-muted); cursor: default; }
.mock-btn-confirm {
  background: var(--color-danger);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
}

/* Tip/warning callouts */
.guide-tip {
  background: #e8f5e9;
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: .9rem;
}
.guide-tip ul { margin-top: 6px; margin-left: 18px; }
.guide-tip li { margin-bottom: 3px; }

.guide-warning-box {
  background: #fff8e1;
  border-left: 4px solid #fb8c00;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: .9rem;
}

/* Approver button preview */
.guide-btn-preview {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.mock-approve-btn {
  background: #2e7d32;
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 24px;
  font-weight: 700;
  font-size: 1rem;
}
.mock-reject-btn {
  background: var(--color-danger);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 24px;
  font-weight: 700;
  font-size: 1rem;
}

/* FAQ */
.guide-faq { display: flex; flex-direction: column; gap: 2px; }

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-q {
  background: #f6f8fa;
  padding: 12px 16px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
}

.faq-a {
  padding: 12px 16px;
  font-size: .92rem;
  line-height: 1.6;
  background: #fff;
}

/* Footer nav */
.guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
}

@media (max-width: 520px) {
  .guide-step { flex-direction: column; }
  .guide-section { padding: 20px 16px; }
  .guide-hero { padding: 24px 16px; }
  .guide-nav { flex-direction: column; }
  .guide-btn-preview { flex-direction: column; }
}
