/* ==========================================================================
   CV Creator – style interfejsu aplikacji (uzupełnienie Bootstrap 5)
   ========================================================================== */
:root {
    --brand: #1f3a5f;
    --brand-2: #2f5d8a;
    --brand-soft: #eaf0f7;
    --bs-primary: #1f3a5f;
    --bs-primary-rgb: 31, 58, 95;
    --bs-link-color: #2a5385;
    --bs-link-color-rgb: 42, 83, 133;
    --bs-link-hover-color: #1f3a5f;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: #17304f; --bs-btn-hover-border-color: #17304f;
    --bs-btn-active-bg: #142a45; --bs-btn-active-border-color: #142a45;
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
.text-primary { color: var(--brand) !important; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand); }
.form-control:focus, .form-select:focus { border-color: #7d9cc0; box-shadow: 0 0 0 .2rem rgba(31, 58, 95, .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

.app-body { background: #f3f5f8; min-height: 100vh; display: flex; flex-direction: column; }
.app-navbar { background: linear-gradient(90deg, #172d4a, var(--brand)); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.1rem;
}
.auth-main .brand-mark { background: var(--brand); }
.app-footer { background: #fff; border-top: 1px solid #e3e7ed; }

/* ---------- strona startowa ---------- */
.hero { background: radial-gradient(1200px 400px at 10% -10%, #2f5d8a 0, transparent 60%), linear-gradient(135deg, #142a45, var(--brand)); color: #fff; }
.hero-paper { display: grid; grid-template-columns: 34% 1fr; background: #fff; border-radius: 10px; height: 360px; overflow: hidden; transform: rotate(-2deg); }
.hp-side { background: #f1f4f8; padding: 22px 16px; }
.hp-photo { width: 70px; height: 70px; border-radius: 50%; background: linear-gradient(135deg, #b9c7d8, #8aa2bf); margin: 0 auto 18px; }
.hp-main { padding: 24px 22px; }
.hp-title { height: 18px; width: 70%; background: var(--brand); border-radius: 4px; margin-bottom: 8px; }
.hp-sub { height: 10px; width: 50%; background: #9fb3c8; border-radius: 4px; margin-bottom: 20px; }
.hp-block { margin-bottom: 16px; }
.hp-line { height: 7px; background: #e1e6ec; border-radius: 4px; margin-bottom: 6px; }
.hp-strong { background: #9fb3c8; height: 9px; }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.feature-card { transition: transform .15s ease, box-shadow .15s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 .75rem 1.5rem rgba(20, 40, 70, .1) !important; }

/* ---------- miniatury szablonów ---------- */
.template-thumb {
    --accent: var(--brand);
    position: relative; display: block; aspect-ratio: 210 / 297; background: #fff; border-radius: 6px;
    border: 1px solid #dfe4ea; overflow: hidden;
}
.template-thumb span { position: absolute; display: block; }
.tpl-classic span:nth-child(1) { left: 8%; top: 6%; width: 45%; height: 5%; background: var(--accent); border-radius: 2px; }
.tpl-classic span:nth-child(2) { left: 8%; top: 18%; width: 26%; aspect-ratio: 1; border-radius: 50%; background: #c6d1de; }
.tpl-classic span:nth-child(3) { left: 40%; top: 18%; width: 52%; height: 70%; border-left: 1px solid #dfe4ea; background: repeating-linear-gradient(#fff 0 6%, #e6eaef 6% 8%); }
.tpl-modern span:nth-child(1) { inset: 0 0 auto 0; height: 22%; background: var(--accent); }
.tpl-modern span:nth-child(2) { left: 8%; top: 5%; width: 18%; aspect-ratio: 1; border-radius: 50%; background: #fff; opacity: .8; }
.tpl-modern span:nth-child(3) { right: 0; top: 22%; bottom: 0; width: 30%; background: color-mix(in srgb, var(--accent) 12%, white); }
.tpl-elegant span:nth-child(1) { left: 25%; top: 7%; width: 50%; height: 4%; background: var(--accent); border-radius: 2px; }
.tpl-elegant span:nth-child(2) { left: 10%; top: 17%; width: 80%; height: 1px; background: var(--accent); }
.tpl-elegant span:nth-child(3) { left: 12%; top: 24%; width: 76%; height: 66%; background: repeating-linear-gradient(#fff 0 6%, #e6eaef 6% 8%); }
.tpl-minimal span:nth-child(1) { left: 9%; top: 8%; width: 50%; height: 5%; background: #333; border-radius: 2px; }
.tpl-minimal span:nth-child(2) { left: 9%; top: 15%; width: 30%; height: 2.5%; background: var(--accent); border-radius: 2px; }
.tpl-minimal span:nth-child(3) { left: 9%; top: 26%; width: 82%; height: 64%; background: repeating-linear-gradient(#fff 0 9%, #e6eaef 9% 10%); }
.tpl-executive span:nth-child(1) { left: 0; top: 0; bottom: 0; width: 32%; background: var(--accent); }
.tpl-executive span:nth-child(2) { left: 6%; top: 6%; width: 20%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .6); }
.tpl-executive span:nth-child(3) { left: 40%; top: 7%; width: 52%; height: 80%; background: repeating-linear-gradient(#fff 0 6%, #e6eaef 6% 8%); border-top: 6px solid #333; }

.template-option { cursor: pointer; padding: 8px; border-radius: 10px; border: 2px solid transparent; text-align: center; }
.btn-check:checked + .template-option { border-color: var(--brand); background: var(--brand-soft); }
.btn-check:focus-visible + .template-option { outline: 2px solid var(--brand); }

/* ---------- pulpit ---------- */
.empty-state { background: #fff; border: 2px dashed #d3dae3; }
.cv-card { transition: transform .15s ease, box-shadow .15s ease; overflow: hidden; }
.cv-card:hover { transform: translateY(-3px); box-shadow: 0 .75rem 1.5rem rgba(20, 40, 70, .12) !important; }
.cv-card-thumb { border-radius: 0; border: 0; border-bottom: 1px solid #e6eaef; aspect-ratio: 16 / 11; background-color: #f7f9fb; }

/* ---------- logowanie / rejestracja ---------- */
.auth-body { background: #f3f5f8; }
.auth-wrapper { min-height: 100vh; display: flex; }
.auth-side {
    flex: 0 0 44%; align-items: center; padding: 64px; color: #fff;
    background: radial-gradient(900px 500px at 0% 0%, #2f5d8a 0, transparent 60%), linear-gradient(160deg, #142a45, var(--brand));
}
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; padding: 40px 36px; box-shadow: 0 1rem 3rem rgba(20, 40, 70, .08); }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pw-progress { height: 5px; }
.pw-progress .progress-bar { width: 0; transition: width .2s ease; }
.pw-progress .lvl-1 { width: 20%; background: #dc3545; }
.pw-progress .lvl-2 { width: 40%; background: #fd7e14; }
.pw-progress .lvl-3 { width: 60%; background: #ffc107; }
.pw-progress .lvl-4 { width: 80%; background: #20c997; }
.pw-progress .lvl-5 { width: 100%; background: #198754; }

.error-code { font-size: 6rem; font-weight: 800; color: var(--brand); opacity: .15; line-height: 1; }

/* ---------- kreator ---------- */
.editor-toolbar { position: sticky; top: 64px; z-index: 1010; }
.title-input { max-width: 280px; }
.swatch { --accent: #1f3a5f; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfd6df; }
.btn-check:checked + .swatch { box-shadow: 0 0 0 2px var(--accent); }
.btn-check:focus-visible + .swatch { outline: 2px solid #000; }

.editor-steps .accordion-button { font-weight: 600; }
.editor-steps .accordion-button:not(.collapsed) { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.step-no {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
    border-radius: 50%; background: var(--brand); color: #fff; font-size: .75rem; margin-right: .75rem; flex-shrink: 0;
}
.repeater-item { position: relative; background: #f8fafc; border: 1px solid #e3e8ef; border-radius: 10px; padding: 14px 14px 12px; margin-bottom: 10px; }
.repeater-item.compact { padding: 10px 12px; }
.repeater-item.compact .form-label { display: none; }
.repeater-item.compact .row { padding-right: 104px; }
.repeater-tools { position: absolute; top: 8px; right: 8px; z-index: 2; }
.repeater-item:not(.compact) .row { padding-top: 26px; }
.repeater-item:not(.compact) .repeater-tools { top: 6px; }

.photo-box {
    width: 130px; height: 130px; border-radius: 50%; margin: 0 auto; overflow: hidden; background: #e9eef4;
    display: flex; align-items: center; justify-content: center; font-size: 3.5rem; color: #9aabbf; border: 3px solid #fff; box-shadow: 0 0 0 1px #d8dfe7;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box.loading { opacity: .4; }

.preview-pane { position: sticky; top: 128px; }
.preview-frame-wrap {
    position: relative; overflow-y: auto; overflow-x: hidden; height: calc(100vh - 170px);
    background: #dfe4ea; border-radius: 10px; box-shadow: inset 0 0 0 1px #d3dae3;
}
.preview-frame-wrap iframe {
    display: block; border: 0; width: 794px; height: 1123px; transform-origin: 0 0; background: #fff;
}
.preview-sizer { --frame-h: 1123px; height: var(--frame-h); overflow: hidden; }

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

/* ---------- administracja ---------- */
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; --bs-bg-opacity: .12; }
.admin-nav .nav-link { color: var(--brand); }
.admin-nav .nav-link.active { color: #fff; }
.log-table td { vertical-align: top; }
.log-table pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- instalator ---------- */
.install-steps { display: flex; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.install-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; color: #8a96a6; font-size: .85rem; text-align: center; }
.install-steps li + li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: #d6dde6; z-index: 0; }
.install-steps li.done + li::before, .install-steps li.done + li.current::before { background: var(--brand); }
.install-steps .dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid #d6dde6; display: flex; align-items: center; justify-content: center; font-weight: 600; margin-bottom: 6px; }
.install-steps li.current { color: var(--brand); font-weight: 600; }
.install-steps li.current .dot { border-color: var(--brand); color: var(--brand); }
.install-steps li.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 575px) { .install-steps .label { display: none; } }
