/* ============================================================
   Workday Control — Frontend CSS
   Variables injected from design settings via inline style.
   ============================================================ */

:root {
    --wdc-primary:   #2563eb;
    --wdc-secondary: #1e40af;
    --wdc-font:      Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --wdc-bg:        #f8fafc;
    --wdc-surface:   #ffffff;
    --wdc-border:    #e2e8f0;
    --wdc-text:      #1e293b;
    --wdc-muted:     #64748b;
    --wdc-success:   #16a34a;
    --wdc-danger:    #dc2626;
    --wdc-radius:    12px;
    --wdc-radius-sm: 6px;
    --wdc-shadow:    0 4px 24px rgba(0,0,0,.08);
}

/* ── Reset ───────────────────────────────────────────────────── */
.wdc-app * { box-sizing: border-box; }
.wdc-app {
    font-family: var(--wdc-font);
    color: var(--wdc-text);
    max-width: 680px;
    margin: 0 auto;
    padding: 16px;
}

/* ── App header ──────────────────────────────────────────────── */
.wdc-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--wdc-primary);
    color: #fff;
    border-radius: var(--wdc-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    gap: 12px;
}
.wdc-app-header__user { display: flex; align-items: center; gap: 12px; }
.wdc-avatar {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.25);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
    flex-shrink: 0;
}
.wdc-app-header__name  { font-weight: 600; font-size: 15px; }
.wdc-app-header__id    { font-size: 12px; opacity: .8; margin-top: 2px; }
.wdc-app-header__date  { text-align: right; flex-shrink: 0; }
.wdc-date              { font-size: 13px; opacity: .9; }
.wdc-time              { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Help text ───────────────────────────────────────────────── */
.wdc-help-text {
    background: color-mix(in srgb, var(--wdc-primary) 8%, transparent);
    border-left: 3px solid var(--wdc-primary);
    border-radius: 0 var(--wdc-radius-sm) var(--wdc-radius-sm) 0;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--wdc-text);
    margin-bottom: 16px;
}

/* ── Status row ──────────────────────────────────────────────── */
.wdc-status-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.wdc-status-card {
    background: var(--wdc-surface);
    border: 2px solid var(--wdc-border);
    border-radius: var(--wdc-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color .2s;
}
.wdc-status-card--done    { border-color: var(--wdc-success); background: #f0fdf4; }
.wdc-status-card--pending { border-color: var(--wdc-border); }
.wdc-status-icon           { font-size: 28px; }
.wdc-status-label          { font-size: 13px; color: var(--wdc-muted); font-weight: 500; }
.wdc-status-time           { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Control form ────────────────────────────────────────────── */
.wdc-control-form {
    background: var(--wdc-surface);
    border: 1px solid var(--wdc-border);
    border-radius: var(--wdc-radius);
    box-shadow: var(--wdc-shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.wdc-form-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--wdc-primary);
}

/* ── Questions ───────────────────────────────────────────────── */
.wdc-questions { display: flex; flex-direction: column; gap: 20px; }
.wdc-question-block {
    border: 1px solid var(--wdc-border);
    border-radius: var(--wdc-radius-sm);
    padding: 16px;
    background: var(--wdc-bg);
}
.wdc-question-text {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.5;
}
.wdc-question-text .wdc-q-num {
    display: inline-flex;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--wdc-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: middle;
}
.wdc-options { display: flex; flex-direction: column; gap: 8px; }
.wdc-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid var(--wdc-border);
    border-radius: var(--wdc-radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 14px;
}
.wdc-option-label:hover { border-color: var(--wdc-primary); }
.wdc-option-label input[type=radio],
.wdc-option-label input[type=checkbox] {
    accent-color: var(--wdc-primary);
    width: 18px; height: 18px;
    flex-shrink: 0;
}
.wdc-option-label:has(input:checked) {
    border-color: var(--wdc-primary);
    background: color-mix(in srgb, var(--wdc-primary) 8%, transparent);
}

/* ── Accident section ────────────────────────────────────────── */
.wdc-accident-section {
    margin-top: 20px;
    padding: 14px 16px;
    border: 2px dashed var(--wdc-danger);
    border-radius: var(--wdc-radius-sm);
    background: #fff5f5;
}
.wdc-accident-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--wdc-danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wdc-accident-label input { accent-color: var(--wdc-danger); width: 18px; height: 18px; }

/* ── All done ────────────────────────────────────────────────── */
.wdc-all-done {
    text-align: center;
    padding: 40px 20px;
    background: var(--wdc-surface);
    border: 1px solid var(--wdc-border);
    border-radius: var(--wdc-radius);
    box-shadow: var(--wdc-shadow);
}
.wdc-all-done__icon { font-size: 56px; margin-bottom: 12px; }
.wdc-all-done h2    { font-size: 20px; margin-bottom: 8px; color: var(--wdc-success); }
.wdc-all-done p     { color: var(--wdc-muted); margin-bottom: 20px; }
.wdc-all-done .wdc-btn { margin: 4px; }

/* ── Login card ──────────────────────────────────────────────── */
/* .wdc-app--login and .wdc-login-card were used in templates prior to v1.0.24.
   The current template (v1.0.24+) uses isolated CSS inside template-login.php.
   These rules are intentionally removed to avoid dead weight. */

/* ── Feedback ────────────────────────────────────────────────── */
.wdc-feedback {
    padding: 12px 16px;
    border-radius: var(--wdc-radius-sm);
    font-size: 14px;
    margin-top: 12px;
}
.wdc-feedback--error   { background: #fef2f2; color: var(--wdc-danger); border: 1px solid #fca5a5; }
.wdc-feedback--success { background: #f0fdf4; color: var(--wdc-success); border: 1px solid #86efac; }

/* ── Form controls ───────────────────────────────────────────── */
.wdc-field     { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.wdc-label     { font-size: 13px; font-weight: 500; }
.wdc-input {
    font-family: var(--wdc-font);
    font-size: 15px;
    color: var(--wdc-text);
    background: var(--wdc-surface);
    border: 2px solid var(--wdc-border);
    border-radius: var(--wdc-radius-sm);
    padding: 10px 14px;
    width: 100%;
    transition: border-color .15s;
}
.wdc-input:focus { outline: none; border-color: var(--wdc-primary); }
.wdc-input-group { display: flex; gap: 8px; }
.wdc-input-group .wdc-input { flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────── */
.wdc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--wdc-font);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--wdc-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background .15s, opacity .15s, transform .1s;
    text-decoration: none;
    line-height: 1;
}
.wdc-btn:active               { transform: scale(.98); }
.wdc-btn:disabled             { opacity: .5; cursor: not-allowed; transform: none; }
.wdc-btn--primary             { background: var(--wdc-primary); color: #fff; }
.wdc-btn--primary:hover       { background: var(--wdc-secondary); }
.wdc-btn--secondary           { background: transparent; border-color: var(--wdc-primary); color: var(--wdc-primary); }
.wdc-btn--secondary:hover     { background: color-mix(in srgb, var(--wdc-primary) 8%, transparent); }
.wdc-btn--ghost               { background: transparent; border-color: var(--wdc-border); color: var(--wdc-muted); }
.wdc-btn--ghost:hover         { border-color: var(--wdc-muted); }
.wdc-btn--lg                  { padding: 14px 28px; font-size: 16px; width: 100%; }
.wdc-btn--full                { width: 100%; }
.wdc-btn--sm                  { padding: 7px 14px; font-size: 13px; }

/* ── Form actions ────────────────────────────────────────────── */
.wdc-form-actions { margin-top: 24px; }

/* ── Loading ─────────────────────────────────────────────────── */
.wdc-loading { text-align: center; color: var(--wdc-muted); padding: 20px; font-size: 14px; }

/* ── App footer ──────────────────────────────────────────────── */
.wdc-app-footer { text-align: center; margin-top: 16px; }

/* ── Certificate ─────────────────────────────────────────────── */
.wdc-cert-actions {
  margin-bottom: 16px;
  text-align: center;
}
.wdc-certificate-viewer {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}
.wdc-cert-frame {
  border: 1px solid var(--wdc-border);
  border-radius: var(--wdc-radius);
  overflow: hidden;
  background: #f8fafc;
}
.wdc-cert-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
}
.wdc-certificate-pdf-frame {
  display: block;
  width: 1100px;
  min-width: 1100px;
  height: 1180px;
  border: 0;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .10);
}
@media (max-width: 768px) {
  .wdc-certificate-viewer {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  .wdc-cert-actions .wdc-btn {
    width: auto;
    max-width: 92%;
    white-space: normal;
  }
  .wdc-cert-frame {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .wdc-cert-scroll {
    padding: 8px;
  }
}
.wdc-progress-wrap { margin-top: 12px; }
.wdc-progress      { height: 6px; background: var(--wdc-border); border-radius: 3px; overflow: hidden; }
.wdc-progress-bar  { height: 100%; background: var(--wdc-primary); border-radius: 3px; transition: width .3s; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .wdc-app { padding: 10px; }
    .wdc-app-header { flex-direction: column; align-items: flex-start; }
    .wdc-status-row { grid-template-columns: 1fr; }
    .wdc-control-form { padding: 16px; }
}

/* ── Induction card ──────────────────────────────────────────── */
.wdc-induction-card {
    background: var(--wdc-surface);
    border: 1px solid var(--wdc-border);
    border-radius: var(--wdc-radius);
    box-shadow: var(--wdc-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.wdc-induction-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--wdc-primary);
    padding: 20px 24px 8px;
    margin: 0;
}
.wdc-induction-desc {
    font-size: 14px;
    color: var(--wdc-muted);
    padding: 0 24px 16px;
    margin: 0;
    line-height: 1.6;
}

/* ── Asset viewers ───────────────────────────────────────────── */
.wdc-asset-viewer      { background: #000; }
.wdc-video-wrap        { position: relative; }
.wdc-video {
    width: 100%;
    max-height: 420px;
    display: block;
    background: #000;
}
.wdc-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.wdc-video-overlay__msg {
    background: rgba(0,0,0,.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.wdc-image-wrap { background: var(--wdc-bg); padding: 20px; text-align: center; }
.wdc-induction-image { max-width: 100%; max-height: 500px; object-fit: contain; border-radius: 4px; }
.wdc-document-frame  { width: 100%; height: 500px; border: none; display: block; }

/* ── Progress section ────────────────────────────────────────── */
.wdc-progress-section  { padding: 16px 24px; border-top: 1px solid var(--wdc-border); }
.wdc-progress-info     { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; color: var(--wdc-muted); }
.wdc-progress-label    { font-weight: 600; color: var(--wdc-primary); }
.wdc-progress--complete { background: var(--wdc-success) !important; }
.wdc-status--success    { color: var(--wdc-success); font-weight: 600; }
.wdc-induction-done {
    padding: 14px 24px;
    border-top: 1px solid var(--wdc-border);
    color: var(--wdc-success);
    font-weight: 600;
    font-size: 15px;
    background: #f0fdf4;
}

/* ── Induction actions ───────────────────────────────────────── */
.wdc-induction-actions { padding: 20px 24px; border-top: 1px solid var(--wdc-border); background: var(--wdc-bg); }

/* ── Account page ────────────────────────────────────────────── */
.wdc-account-section   { margin-bottom: 28px; }
.wdc-section-title     { font-size: 16px; font-weight: 700; color: var(--wdc-primary); margin: 0 0 14px; border-bottom: 2px solid var(--wdc-border); padding-bottom: 8px; }
.wdc-empty             { color: var(--wdc-muted); font-size: 14px; padding: 16px 0; }
.wdc-account-table-wrap { overflow-x: auto; border: 1px solid var(--wdc-border); border-radius: var(--wdc-radius); }
.wdc-account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.wdc-account-table th {
    background: var(--wdc-bg);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--wdc-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--wdc-border);
}
.wdc-account-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--wdc-border);
    vertical-align: middle;
}
.wdc-account-table tr:last-child td { border-bottom: none; }
.wdc-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}
.wdc-type-badge--entrance { background: #dcfce7; color: #166534; }
.wdc-type-badge--exit     { background: #fee2e2; color: #991b1b; }
.wdc-cert-link     { color: var(--wdc-primary); text-decoration: none; font-size: 13px; font-weight: 500; }
.wdc-cert-link:hover { text-decoration: underline; }
.wdc-status-pill   { font-size: 12px; font-weight: 500; }
.wdc-status-pill--done    { color: var(--wdc-success); }
.wdc-status-pill--pending { color: var(--wdc-muted); }

/* ── Language switcher ───────────────────────────────────────── */
.wdc-lang-switcher,
.wdc-lang-bar {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 12px;
}
.wdc-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 99px;
    border: 2px solid var(--wdc-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--wdc-muted);
    text-decoration: none;
    transition: all .15s;
    background: var(--wdc-surface);
}
.wdc-lang-btn:hover           { border-color: var(--wdc-primary); color: var(--wdc-primary); }
.wdc-lang-btn--active         { border-color: var(--wdc-primary); color: var(--wdc-primary); background: color-mix(in srgb, var(--wdc-primary) 8%, transparent); }

/* ── Password field fix ──────────────────────────────────────── */

/* ── iOS / mobile input fix — prevents auto-zoom ────────────────────────────
   Minimum 16px on all inputs in the plugin. Placed here so it always applies
   regardless of which template or theme is active. */
.wdc-app input[type='text'],
.wdc-app input[type='password'],
.wdc-app input[type='email'],
.wdc-app input[type='tel'],
.wdc-app input[type='number'],
.wdc-app input[type='date'],
.wdc-app select,
.wdc-app textarea {
    font-size: 16px !important;
}

/* ── Floating accident button / modal ────────────────────────────────────── */
.wdc-accident-fab {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--wdc-danger, #dc2626);
    color: #fff;
    font-family: var(--wdc-font);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.wdc-accident-fab:hover { filter: brightness(.95); }
.wdc-btn--danger { background: var(--wdc-danger, #dc2626); color: #fff; border-color: var(--wdc-danger, #dc2626); }
.wdc-btn--danger:hover { background: #b91c1c; }
.wdc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15,23,42,.55);
}
.wdc-modal-simple {
    width: min(420px, 100%);
    background: var(--wdc-surface, #fff);
    border-radius: var(--wdc-radius, 12px);
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
    padding: 26px;
    text-align: center;
}
.wdc-modal-simple__icon { font-size: 42px; margin-bottom: 10px; }
.wdc-modal-simple h3 { margin: 0 0 10px; font-size: 20px; color: var(--wdc-text, #0f172a); }
.wdc-modal-simple p { margin: 0 0 20px; color: var(--wdc-muted, #64748b); line-height: 1.5; }
.wdc-modal-simple__actions { display: grid; gap: 10px; }
@media (max-width: 480px) {
    .wdc-accident-fab { left: 12px; right: 12px; bottom: 14px; width: auto; }
}

