/* Page-level compositions — layouts specific to one page/flow, built from the primitives in
   components.css. Keep additions here organized under a "---- Page ----" banner per page. */

/* ---------- Welcome / Login / Workspace ---------- */
.gp-welcome {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--gp-space-6) var(--gp-space-4);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(160deg, var(--gp-navy-900) 0%, var(--gp-navy-700) 55%, var(--gp-navy-600) 100%);
  position: relative;
}
.gp-welcome-lang { position: absolute; top: var(--gp-space-5); inset-inline-end: var(--gp-space-5); display: flex; gap: var(--gp-space-2); }
.gp-welcome-lang a { color: rgba(255,255,255,.7); text-decoration: none; font-weight: 700; font-size: var(--gp-fs-sm); padding: 4px 10px; border-radius: var(--gp-radius-pill); }
.gp-welcome-lang a.is-active, .gp-welcome-lang a:hover { color: var(--gp-white); background: rgba(255,255,255,.14); }

.gp-welcome-card {
  background: var(--gp-white); border-radius: var(--gp-radius-lg); box-shadow: 0 28px 64px rgba(5,25,15,.38);
  padding: var(--gp-space-7) var(--gp-space-6); width: 100%; max-width: 620px; text-align: center;
}
.gp-login-card { max-width: 420px; text-align: start; position: relative; }
.gp-welcome-mark {
  width: 56px; height: 56px; border-radius: var(--gp-radius-md);
  background: linear-gradient(155deg, var(--gp-navy-600), var(--gp-navy-800)); color: var(--gp-white);
  display: flex; align-items: center; justify-content: center; margin: 0 auto var(--gp-space-4);
  box-shadow: 0 6px 16px rgba(11, 46, 28, 0.28);
}
.gp-login-card .gp-welcome-mark { margin-inline: 0; }
.gp-welcome-card h1 { font-size: var(--gp-fs-xl); margin-bottom: var(--gp-space-2); }
.gp-welcome-sub { color: var(--gp-text-muted); max-width: 48ch; margin-inline: auto var(--gp-space-6); }
.gp-login-card .gp-welcome-sub { margin-inline: 0; }
.gp-login-card .eyebrow { display: block; margin-bottom: var(--gp-space-2); }
.gp-login-card .alert { margin-bottom: var(--gp-space-4); text-align: start; }
.gp-login-register-hint { margin: var(--gp-space-5) 0 0; text-align: center; font-size: var(--gp-fs-sm); color: var(--gp-text-muted); }
.gp-login-register-hint a { font-weight: 700; text-decoration: none; margin-inline-start: 4px; }
.gp-login-register-hint a:hover { text-decoration: underline; }

.gp-back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--gp-text-muted); text-decoration: none; font-size: var(--gp-fs-sm); font-weight: 600; margin-bottom: var(--gp-space-5); }
.gp-back-link:hover { color: var(--gp-navy-700); }

.gp-persona-icon { width: 44px; height: 44px; border-radius: var(--gp-radius-md); background: var(--gp-navy-50); color: var(--gp-navy-700); display: flex; align-items: center; justify-content: center; }

.gp-workspace-option { display: flex; align-items: center; gap: var(--gp-space-3); padding: var(--gp-space-4); cursor: pointer; }
.gp-workspace-option input { width: 18px; height: 18px; accent-color: var(--gp-navy-700); }
.gp-workspace-name { font-weight: 700; flex: 1; }
.gp-workspace-option:has(input:checked) { border-color: var(--gp-navy-600); box-shadow: var(--gp-shadow-focus); }

@media (max-width: 560px) {
  .gp-welcome-card { padding: var(--gp-space-6) var(--gp-space-4); }
}

/* ---------- Home ---------- */
.gp-search {
  display: flex; align-items: center; gap: var(--gp-space-3); background: var(--gp-white); border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-md); padding: var(--gp-space-3) var(--gp-space-3) var(--gp-space-3) var(--gp-space-4);
  margin-bottom: var(--gp-space-6); box-shadow: var(--gp-shadow-sm); color: var(--gp-ink-300);
}
[dir="rtl"] .gp-search { padding: var(--gp-space-3) var(--gp-space-4) var(--gp-space-3) var(--gp-space-3); }
.gp-search-input { border: none; box-shadow: none !important; padding-inline-start: 0; padding-block: 0; }
.gp-search-input:focus { box-shadow: none; }

.gp-home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gp-space-4); margin-bottom: var(--gp-space-7); }
.gp-quick-card { display: flex; gap: var(--gp-space-4); align-items: flex-start; padding: var(--gp-space-5); text-decoration: none; color: inherit; }
.gp-quick-card h3 { margin: 0 0 4px; }
.gp-quick-card p { margin: 0; font-size: var(--gp-fs-sm); }

.gp-section { margin-bottom: var(--gp-space-7); }
.gp-request-row { display: flex; align-items: center; justify-content: space-between; gap: var(--gp-space-4); padding: var(--gp-space-4) var(--gp-space-5); text-decoration: none; color: inherit; }

.gp-help-card { display: flex; align-items: flex-start; gap: var(--gp-space-4); color: var(--gp-navy-700); }
.gp-help-card h3 { margin: 0 0 4px; color: var(--gp-text); }
.gp-help-card p { margin: 0; }

@media (max-width: 700px) {
  .gp-home-grid { grid-template-columns: 1fr; }
  .gp-search { flex-wrap: wrap; }
}

/* ---------- Services catalogue / details ---------- */
.gp-service-icon {
  width: 46px; height: 46px; border-radius: var(--gp-radius-md);
  background: linear-gradient(155deg, var(--gp-navy-100), var(--gp-navy-50)); color: var(--gp-navy-700);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gp-service-icon-lg { width: 60px; height: 60px; border-radius: var(--gp-radius-lg); }
.gp-service-card { padding: var(--gp-space-5); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: var(--gp-space-2); position: relative; overflow: hidden; }
.gp-service-card::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px;
  background: linear-gradient(90deg, var(--gp-navy-600), var(--gp-navy-500)); opacity: 0; transition: opacity var(--gp-transition);
}
.gp-service-card:hover::before { opacity: 1; }
.gp-service-card h3 { margin: var(--gp-space-3) 0 0; font-size: var(--gp-fs-md); }
.gp-service-card p { font-size: var(--gp-fs-sm); color: var(--gp-text-muted); margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gp-service-cta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--gp-fs-sm); font-weight: 700; color: var(--gp-navy-700); margin-top: var(--gp-space-2); }

.gp-crumb { display: flex; align-items: center; gap: 6px; font-size: var(--gp-fs-sm); color: var(--gp-text-muted); margin-bottom: var(--gp-space-4); flex-wrap: wrap; }
.gp-crumb a { color: var(--gp-text-muted); text-decoration: none; font-weight: 600; }
.gp-crumb a:hover { color: var(--gp-navy-700); }
.gp-crumb span { color: var(--gp-text); font-weight: 600; }

.gp-service-detail { max-width: 760px; }
.gp-service-detail-head { display: flex; align-items: flex-start; gap: var(--gp-space-4); margin-bottom: var(--gp-space-5); }
.gp-service-detail-head h1 { margin-bottom: var(--gp-space-2); }
.gp-detail-subhead { font-size: var(--gp-fs-base); text-transform: uppercase; letter-spacing: .04em; color: var(--gp-text-muted); font-weight: 700; margin: var(--gp-space-5) 0 var(--gp-space-3); }
.gp-service-detail-actions { display: flex; gap: var(--gp-space-3); margin-top: var(--gp-space-6); flex-wrap: wrap; }

/* ---------- Dynamic form ---------- */
/* Two-column apply-page layout: form card (fixed width, unchanged) + a sticky progress sidebar
   filling the space already empty beside it on desktop. Sidebar moves above the form and stops
   being sticky below the breakpoint, per the explicit mobile requirement. */
.gp-apply-layout { display: flex; align-items: flex-start; gap: var(--gp-space-6); }
.gp-apply-sidebar { flex: 1 1 280px; min-width: 260px; position: sticky; top: calc(var(--gp-header-h) + var(--gp-space-5)); }
@media (max-width: 960px) {
  .gp-apply-layout { flex-direction: column; }
  .gp-apply-sidebar { position: static; width: 100%; order: -1; }
  .gp-progress-sections { max-height: none; }
}
.gp-form-card { max-width: 820px; flex: 1 1 820px; }
.gp-form-header { display: flex; align-items: flex-start; gap: var(--gp-space-4); margin-bottom: var(--gp-space-6); padding-bottom: var(--gp-space-5); border-bottom: 1px solid var(--gp-border); }
.gp-form-header h1 { margin-bottom: 4px; }
.gp-form-section-title { font-size: var(--gp-fs-base); font-weight: 700; color: var(--gp-text); margin: var(--gp-space-6) 0 var(--gp-space-4); display: flex; align-items: center; gap: var(--gp-space-2); }
.gp-form-section-title:first-child { margin-top: 0; }
.gp-form-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gp-space-4) var(--gp-space-5); }
.gp-form-fields .field { margin-bottom: 0; }
.field-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .gp-form-fields { grid-template-columns: 1fr; }
}
.gp-form-footer {
  display: flex; align-items: center; gap: var(--gp-space-4); justify-content: space-between; flex-wrap: wrap;
  margin-top: var(--gp-space-7); padding-top: var(--gp-space-5); border-top: 1px solid var(--gp-border);
}
.gp-form-actions { display: flex; gap: var(--gp-space-3); flex-wrap: wrap; }
.gp-required-note { font-size: var(--gp-fs-xs); color: var(--gp-text-muted); }

/* ---------- Confirmation ---------- */
.gp-confirm { max-width: 560px; margin-inline: auto; text-align: center; }
.gp-confirm-icon {
  width: 76px; height: 76px; border-radius: 50%; background: var(--gp-success-100); color: var(--gp-success-600);
  display: flex; align-items: center; justify-content: center; margin: 0 auto var(--gp-space-4);
  box-shadow: 0 0 0 8px rgba(22, 163, 74, 0.08);
}
.gp-confirm-card { text-align: start; margin: var(--gp-space-6) 0; }
.gp-confirm-row { display: flex; justify-content: space-between; align-items: center; padding: var(--gp-space-3) 0; border-bottom: 1px solid var(--gp-border); font-size: var(--gp-fs-sm); }
.gp-confirm-row:last-child { border-bottom: none; }
.gp-confirm-row span { color: var(--gp-text-muted); }

/* ---------- Request details ---------- */
.gp-detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gp-space-5); align-items: start; }
.gp-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gp-space-4); position: relative; }
.gp-timeline-item { display: flex; align-items: center; gap: var(--gp-space-3); font-size: var(--gp-fs-sm); color: var(--gp-text-muted); position: relative; }
.gp-timeline-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gp-ink-200); flex-shrink: 0; }
.gp-timeline-item.is-done { color: var(--gp-text); }
.gp-timeline-item.is-done .gp-timeline-dot { background: var(--gp-success-600); }
.gp-timeline-item.is-current { color: var(--gp-navy-700); font-weight: 700; }
.gp-timeline-item.is-current .gp-timeline-dot { background: var(--gp-navy-600); box-shadow: 0 0 0 4px var(--gp-navy-100); }
.gp-timeline-via { font-size: var(--gp-fs-xs); }
.gp-kv { display: grid; grid-template-columns: auto 1fr; gap: var(--gp-space-3) var(--gp-space-4); margin: 0; font-size: var(--gp-fs-sm); }
.gp-kv dt { color: var(--gp-text-muted); }
.gp-kv dd { margin: 0; font-weight: 600; text-align: end; }

/* ---------- Audit Log (mirrors Service-Portal's Instance.razor data/behavior) ---------- */
.gp-audit-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--gp-space-4); }
.gp-audit-count { font-size: var(--gp-fs-xs); }
.gp-audit-log { display: flex; flex-direction: column; gap: var(--gp-space-4); max-height: 420px; overflow-y: auto; padding-inline-end: 8px; margin-inline-end: -8px; scrollbar-width: thin; scrollbar-color: var(--gp-ink-200) transparent; }
.gp-audit-log::-webkit-scrollbar { width: 6px; }
.gp-audit-log::-webkit-scrollbar-track { background: transparent; }
.gp-audit-log::-webkit-scrollbar-thumb { background-color: var(--gp-ink-200); border-radius: var(--gp-radius-pill); }
.gp-audit-log::-webkit-scrollbar-thumb:hover { background-color: var(--gp-ink-300); }

.gp-audit-row { display: flex; gap: var(--gp-space-3); align-items: flex-start; }
.gp-audit-icon {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  flex-shrink: 0; margin-top: 2px;
}
.gp-audit-icon.is-system { background: var(--gp-ink-100); color: var(--gp-ink-500); }
.gp-audit-icon.is-user { background: var(--gp-success-100); color: var(--gp-success-600); }
.gp-audit-icon.is-error { background: var(--gp-danger-100); color: var(--gp-danger-600); }
.gp-audit-body { flex: 1; min-width: 0; }
.gp-audit-title { font-size: var(--gp-fs-sm); color: var(--gp-text); text-transform: capitalize; }
.gp-audit-meta { font-size: var(--gp-fs-xs); color: var(--gp-text-muted); margin-top: 1px; }
.gp-audit-note {
  margin-top: var(--gp-space-2); font-size: var(--gp-fs-xs); color: var(--gp-text-muted);
  font-style: italic; word-break: break-word;
}
.gp-audit-note.is-error {
  color: var(--gp-danger-600); font-style: normal; font-weight: 500; background: var(--gp-danger-100);
  border-radius: var(--gp-radius-sm); padding: var(--gp-space-2) var(--gp-space-3); margin-top: var(--gp-space-2);
}

@media (max-width: 800px) {
  .gp-detail-grid { grid-template-columns: 1fr; }
}

/* ---------- TEMPORARY DEBUG FEATURE — request/response panel (see HttpCallCapture.cs) ----------
   Deliberately styled like a dev console (dark header, monospace blocks), visually distinct from the
   rest of the citizen-facing design, so it reads unmistakably as a developer tool, not a finished
   page. Delete this whole block when the feature is removed — nothing else references these classes. */
.gp-debug-panel { margin-top: var(--gp-space-6); border-color: var(--gp-ink-700); }
.gp-debug-head {
  display: flex; align-items: center; gap: var(--gp-space-2); font-weight: 700; color: var(--gp-ink-700);
  margin-bottom: var(--gp-space-5); padding-bottom: var(--gp-space-4); border-bottom: 1px dashed var(--gp-border);
}
.gp-debug-call + .gp-debug-call { margin-top: var(--gp-space-6); padding-top: var(--gp-space-5); border-top: 1px dashed var(--gp-border); }
.gp-debug-call-title { display: flex; align-items: center; gap: var(--gp-space-3); font-weight: 700; font-size: var(--gp-fs-md); margin-bottom: var(--gp-space-3); }
.gp-debug-section-label {
  font-size: var(--gp-fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gp-text-muted); margin: var(--gp-space-4) 0 var(--gp-space-2);
}
.gp-debug-section-label:first-of-type { margin-top: var(--gp-space-2); }
.gp-debug-method-url { font-size: var(--gp-fs-sm); word-break: break-all; }
.gp-debug-method { font-weight: 800; color: var(--gp-navy-700); margin-inline-end: var(--gp-space-2); }
.gp-debug-subhead { font-size: var(--gp-fs-xs); font-weight: 700; color: var(--gp-text-muted); margin-bottom: 4px; }
.gp-debug-pre {
  background: var(--gp-ink-900); color: #d6e4dc; font-family: var(--gp-font-mono); font-size: 12px; line-height: 1.6;
  padding: var(--gp-space-3) var(--gp-space-4); border-radius: var(--gp-radius-sm); overflow-x: auto;
  white-space: pre-wrap; word-break: break-word; margin: 0 0 var(--gp-space-2);
}
.gp-debug-pre.gp-debug-error { background: #3a1210; color: #ffd4d0; }
