/* ==========================================================================
   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; }

.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 { display: block; aspect-ratio: 16 / 11; overflow: hidden; background: #eef1f5; border-bottom: 1px solid #e6eaef; padding: 14px 18% 0; }
.cv-card-thumb img { width: 100%; display: block; border-radius: 4px 4px 0 0; box-shadow: 0 4px 16px rgba(20, 40, 70, .15); transition: transform .2s ease; }
.cv-card:hover .cv-card-thumb img { transform: translateY(-4px); }
.template-option-img { width: 100%; border-radius: 4px; box-shadow: 0 2px 8px rgba(20, 40, 70, .15); display: block; }

/* ---------- 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; } }

/* ---------- strona główna ---------- */
.home-hero {
    color: #fff; overflow: hidden; position: relative;
    background: radial-gradient(900px 420px at 0% 0%, #2f5d8a 0, transparent 60%), radial-gradient(700px 400px at 100% 100%, #2c4f7a 0, transparent 60%), linear-gradient(135deg, #132840, var(--brand));
}
.hero-badge { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 500; padding: .5em 1em; }
.hero-points li { opacity: .9; }
.hero-points i { color: #7fd1b9; }
.hero-stack { position: relative; height: 470px; }
.hero-cv { position: absolute; width: 56%; border-radius: 6px; box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .35); background: #fff; }
.hero-cv-1 { left: 0; top: 40px; transform: rotate(-7deg); opacity: .92; }
.hero-cv-2 { left: 22%; top: 0; z-index: 2; }
.hero-cv-3 { right: 0; top: 50px; transform: rotate(6deg); opacity: .92; }
.hero-float {
    position: absolute; z-index: 3; background: #fff; color: #24303f; border-radius: 999px; padding: .55rem 1rem;
    font-size: .85rem; font-weight: 600; box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .25); white-space: nowrap;
    animation: float 5s ease-in-out infinite;
}
.hero-float-1 { left: -4%; top: 58%; }
.hero-float-2 { right: -2%; top: 12%; animation-delay: -1.6s; }
.hero-float-3 { right: 8%; bottom: 4%; animation-delay: -3.2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .hero-float { animation: none; } }

.section-kicker { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-2); background: var(--brand-soft); padding: .3rem .8rem; border-radius: 999px; }

.tpl-strip { display: flex; gap: 1.25rem; overflow-x: auto; padding: .5rem .25rem 1.25rem; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.tpl-strip-item { flex: 0 0 200px; scroll-snap-align: start; text-decoration: none; color: inherit; }
.tpl-strip-item img { width: 100%; border-radius: 8px; box-shadow: 0 .5rem 1.25rem rgba(20, 40, 70, .14); transition: transform .2s ease, box-shadow .2s ease; display: block; background: #fff; }
.tpl-strip-item:hover img { transform: translateY(-6px); box-shadow: 0 1rem 2rem rgba(20, 40, 70, .2); }
.tpl-strip-name { display: block; text-align: center; font-weight: 600; margin-top: .6rem; }

.step-badge { display: inline-flex; align-items: center; gap: .6rem; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: .35rem .9rem .35rem .35rem; font-size: 1.1rem; }
.step-badge span { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; }

.browser-frame { border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid #dfe4ea; }
.browser-bar { height: 30px; background: #eef1f5; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid #dfe4ea; }
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: #f0625a; }
.browser-bar span:nth-child(2) { background: #f6be4f; }
.browser-bar span:nth-child(3) { background: #5bc463; }
.browser-frame img { width: 100%; height: auto; display: block; }

.features-band { background: #fff; border: 1px solid #e6eaf0; }
.feature-tile { padding: 1.25rem; border-radius: 12px; background: #f8fafc; border: 1px solid #edf1f5; transition: transform .15s ease, box-shadow .15s ease; }
.feature-tile:hover { transform: translateY(-3px); box-shadow: 0 .75rem 1.5rem rgba(20, 40, 70, .08); background: #fff; }
.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; }

.check-list li { position: relative; padding-left: 1.9rem; margin-bottom: .6rem; }
.check-list li::before { content: "\F26A"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 0; color: #198754; font-size: 1.15rem; line-height: 1.3; }

.persona-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid #e6eaf0; transition: transform .15s ease, box-shadow .15s ease; }
.persona-card:hover { transform: translateY(-4px); box-shadow: 0 1rem 2rem rgba(20, 40, 70, .1); }
.persona-top { position: relative; height: 150px; background: linear-gradient(135deg, var(--brand-soft), #f7f9fc); overflow: hidden; }
.persona-cv { position: absolute; right: 12%; top: 18px; width: 46%; transform: rotate(4deg); border-radius: 4px; box-shadow: 0 .5rem 1rem rgba(20, 40, 70, .18); }
.persona-avatar { position: absolute; left: 16px; bottom: -0px; width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 .25rem .75rem rgba(20, 40, 70, .15); }

.tip-card { position: relative; background: #fff; border-radius: 12px; border: 1px solid #e6eaf0; padding: 1.25rem 1.25rem 1.25rem 4rem; }
.tip-no { position: absolute; left: 1.1rem; top: 1.1rem; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.faq .accordion-button { font-weight: 600; }
.faq .accordion-button:not(.collapsed) { background: var(--brand-soft); color: var(--brand); box-shadow: none; }

.cta-band, .page-hero { color: #fff; background: radial-gradient(800px 300px at 100% 0%, #2f5d8a 0, transparent 60%), linear-gradient(135deg, #132840, var(--brand)); }
.page-hero-lead { max-width: 720px; }

/* ---------- galeria szablonów ---------- */
.tpl-card-img { position: relative; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 .5rem 1.25rem rgba(20, 40, 70, .12); }
.tpl-card-img img { width: 100%; height: auto; display: block; transition: transform .3s ease; }
.tpl-card-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; background: rgba(19, 40, 64, .55); opacity: 0; transition: opacity .2s ease; }
.tpl-card:hover .tpl-card-overlay, .tpl-card:focus-within .tpl-card-overlay { opacity: 1; }
.tpl-card:hover .tpl-card-img img { transform: scale(1.03); }
@media (hover: none) { .tpl-card-overlay { opacity: 1; background: linear-gradient(to top, rgba(19, 40, 64, .7), transparent 45%); justify-content: flex-end; flex-direction: row; padding-bottom: 1rem; } }

/* ---------- proporcje obrazów ----------
   Obrazy mają atrybuty width/height (rezerwacja miejsca), więc przy skalowaniu szerokości
   wysokość musi być liczona automatycznie – inaczej obraz zostaje rozciągnięty. */
.hero-cv, .tpl-strip-item img, .persona-cv, .cv-card-thumb img, .template-option-img, .tpl-card-img img, .browser-frame img {
    height: auto;
    max-width: 100%;
}
.hero-cv, .tpl-strip-item img, .persona-cv, .cv-card-thumb img, .template-option-img, .tpl-card-img img {
    aspect-ratio: 635 / 898;
    object-fit: cover;
    object-position: top;
}
.browser-frame img { aspect-ratio: 1440 / 860; object-fit: cover; object-position: top; }
.hero-cv { max-width: 300px; }
.hero-cv-2 { left: 50%; margin-left: -150px; }
.hero-cv-1 { left: 2%; }
.hero-cv-3 { right: 2%; }
@media (max-width: 1199px) { .hero-cv { max-width: 240px; } .hero-cv-2 { margin-left: -120px; } .hero-stack { height: 400px; } }

/* ---------- kreator: nazwy sekcji ---------- */
.section-title-edit { background: #f4f7fb; border: 1px dashed #c9d5e3; border-radius: 10px; padding: 10px 12px; }
.section-title-edit .form-control { font-weight: 600; }
.title-default { font-weight: 400; font-size: .8rem; color: #8a96a6; }

/* ---------- kreator: własne sekcje ---------- */
.repeater-item.custom-section { background: #fff; border: 1px solid #cfd9e6; border-left: 4px solid var(--brand); }
.repeater-item.nested { background: #f8fafc; }
.repeater-item.nested .row { padding-top: 26px; }

/* ---------- SEO: stopka, poradniki, strony szablonów ---------- */
.brand-mark-sm { width: 28px; height: 28px; font-size: .9rem; border-radius: 7px; background: var(--brand); }
.footer-head { font-weight: 600; color: #24303f; margin-bottom: .5rem; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a { color: #5f6b7a; text-decoration: none; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumb { --bs-breadcrumb-divider-color: #9aa5b3; }
.breadcrumb a { text-decoration: none; }

.lang-card { background: #fff; border: 1px solid #e6eaf0; border-radius: 14px; padding: 1.75rem; }
.lang-flag { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; letter-spacing: .05em; }
.seo-text { background: #fff; border: 1px solid #e6eaf0; color: #3c4756; }
.seo-text p { line-height: 1.7; }

.guide { font-size: 1.05rem; line-height: 1.75; color: #2c3644; }
.guide h2 { font-size: 1.6rem; font-weight: 700; margin: 2.5rem 0 1rem; scroll-margin-top: 80px; }
.guide h3 { font-size: 1.2rem; font-weight: 600; margin: 1.75rem 0 .6rem; }
.guide .toc { background: #fff; border: 1px solid #e6eaf0; }
.guide .toc a { text-decoration: none; }
.guide blockquote.example { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 1rem 1.25rem; border-radius: 0 10px 10px 0; font-style: italic; }
.compare { border-radius: 10px; padding: 1rem 1.25rem; font-size: .98rem; }
.compare-bad { background: #fdf0f0; border: 1px solid #f3cccc; }
.compare-bad .fw-semibold { color: #b02a37; }
.compare-good { background: #eef8f2; border: 1px solid #c7e7d3; }
.compare-good .fw-semibold { color: #146c43; }
.cta-inline { color: #fff; background: linear-gradient(135deg, #132840, var(--brand)); }
.related a { white-space: nowrap; }

.tpl-detail-img { border-radius: 12px; overflow: hidden; box-shadow: 0 1rem 2.5rem rgba(20, 40, 70, .18); background: #fff; }
.tpl-detail-img img { width: 100%; height: auto; display: block; }
.tpl-howto { background: var(--brand-soft); }
.tpl-mini img { width: 100%; height: auto; aspect-ratio: 635 / 898; border-radius: 8px; box-shadow: 0 .5rem 1.25rem rgba(20, 40, 70, .12); transition: transform .2s ease; }
.tpl-mini:hover img { transform: translateY(-4px); }
picture { display: contents; }

/* ---------- moduł SEO (admin) ---------- */
.seo-path { min-width: 150px; }
.serp { background: #fff; border: 1px solid #e3e7ec; border-radius: 10px; padding: 14px 16px; font-family: Arial, sans-serif; }
.serp-url { font-size: 13px; color: #202124; margin-bottom: 4px; }
.serp-title { font-size: 19px; color: #1a0dab; line-height: 1.3; margin-bottom: 4px; }
.serp-desc { font-size: 14px; color: #4d5156; line-height: 1.55; }

/* ---------- płatności ---------- */
.checkout-preview { background: linear-gradient(135deg, var(--brand-soft), #f7f9fc); }
.checkout-preview img { max-height: 380px; width: auto; }
.blik-mark { display: inline-flex; align-items: center; justify-content: center; background: #000; color: #fff; font-weight: 800; font-style: italic; letter-spacing: -.02em; border-radius: 6px; padding: 0 .45rem; margin-right: .6rem; font-size: .95em; line-height: 1.6; box-shadow: inset 0 -3px 0 #e6007e; }
.blik-mark-lg { font-size: 1.8rem; padding: .1rem .8rem; margin: 0 0 1rem; }
.blik-btn { display: inline-flex; align-items: center; justify-content: center; }
.blik-btn .blik-mark { background: #fff; color: #000; }
.blik-input { font-size: 2rem; letter-spacing: .5em; font-weight: 700; }
.cv-col { max-width: 200px; }
.ref-col { max-width: 140px; }
.pulse { animation: pulse 1.6s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 .5rem rgba(25, 135, 84, .25); } }
