/* ==============================================================
   GETAXS Career Suite - style.css
   www.getaxs.de/cv
   ============================================================== */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700&family=Cairo:wght@400;500;600;700;800;900&family=Playfair+Display:wght@500;600;700;800&display=swap');

:root {
    --brand-50:  #ecfeff;
    --brand-100: #cffafe;
    --brand-300: #67e8f9;
    --brand-500: #06b6d4;
    --brand-600: #0891b2;
    --brand-700: #0e7490;
    --brand-900: #164e63;

    --gold-400: #fbbf24;
    --gold-500: #f59e0b;
    --gold-600: #d97706;

    --bg:        #f7f8fa;
    --surface:   #ffffff;
    --surface-2: #f3f4f6;
    --border:    #e5e7eb;
    --border-2:  #d1d5db;

    --text:      #0f172a;
    --text-2:    #334155;
    --muted:     #64748b;
    --muted-2:   #94a3b8;

    --success:   #10b981;
    --warning:   #f59e0b;
    --danger:    #ef4444;

    --radius:    10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04);
    --shadow:    0 4px 12px rgba(15,23,42,0.08);
    --shadow-lg: 0 20px 40px rgba(15,23,42,0.12);

    --font-ui:    'Manrope', system-ui, -apple-system, Segoe UI, sans-serif;
    --font-ar:    'Cairo', 'Manrope', sans-serif;
    --font-serif: 'Lora', Georgia, serif;
    --font-display: 'Playfair Display', 'Lora', serif;
    --font-modern: 'Plus Jakarta Sans', 'Manrope', sans-serif;
    --font-light:  'Outfit', 'Manrope', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 15px;
}
html[lang="ar"] body { font-family: var(--font-ar); }

a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-900); }
button { font-family: inherit; }

/* ============================================================
   TOP BAR
============================================================ */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
    color: var(--text);
    text-decoration: none;
}
.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    font-size: 16px;
}
.brand-tag {
    font-weight: 400;
    color: var(--muted);
    font-size: 12px;
}

/* nav */
.top-nav { display: flex; gap: 4px; }
.top-nav a {
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
}
.top-nav a:hover { background: var(--surface-2); }
.top-nav a.active { background: var(--text); color: #fff; }

.lang-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lang-bar .label {
    font-size: 11px;
    color: var(--muted);
    margin: 0 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lang-pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}
.lang-pill:hover { border-color: var(--brand-500); color: var(--brand-700); }
.lang-pill.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.autosave-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    padding: 4px 10px;
    background: var(--surface-2);
    border-radius: 999px;
    transition: opacity .3s;
}
.autosave-pill::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.45);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.45); }
    70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ============================================================
   WIZARD STEPS
============================================================ */
.steps {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    overflow-x: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
}
.step {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all .15s;
    user-select: none;
}
.step:hover { background: #eef2f7; color: var(--text); }
.step.active {
    background: var(--brand-50);
    color: var(--brand-700);
    border-color: var(--brand-300);
}
.step.done { color: var(--success); }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-2);
    font-size: 12px;
    font-weight: 700;
}
.step.active .step-num {
    background: var(--brand-600);
    color: #fff;
    border-color: var(--brand-600);
}
.step.done .step-num {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

/* ============================================================
   LAYOUT
============================================================ */
.layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
    align-items: start;
}
[dir="rtl"] .layout { direction: rtl; }
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
}

/* ============================================================
   EDITOR
============================================================ */
.editor {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}
@media (max-width: 980px) {
    .editor { position: static; max-height: none; }
}
.editor h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 800;
}
.editor .help {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 11px;
    color: var(--text-2);
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.12);
}
.field textarea { resize: vertical; min-height: 90px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row-3 { grid-template-columns: 1fr; } }

/* AI buttons inline */
.field-with-ai { position: relative; }
.ai-btn-row {
    position: absolute;
    top: -2px;
    right: 0;
    display: flex;
    gap: 4px;
    z-index: 2;
}
[dir="rtl"] .ai-btn-row { right: auto; left: 0; }
.btn-ai-inline {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(217,119,6,0.3);
    transition: transform .15s;
}
.btn-ai-inline:hover { transform: translateY(-1px); }
.btn-ai-inline:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-ai-translate {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    box-shadow: 0 2px 6px rgba(2,132,199,0.3);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.checkbox-row input { width: auto; }
.checkbox-row label {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--text);
    font-size: 13px;
}

/* item card */
.item-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    background: var(--surface);
    position: relative;
}
.item-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
.item-card-title {
    font-weight: 700;
    color: var(--text-2);
    font-size: 13px;
}
.btn-remove-item {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--danger);
    border-radius: 999px;
    width: 26px; height: 26px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-remove-item:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-add-item {
    width: 100%;
    padding: 12px;
    border: 1.5px dashed var(--brand-500);
    background: var(--brand-50);
    color: var(--brand-700);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}
.btn-add-item:hover { background: var(--brand-100); }

/* level pills */
.level-pills { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.level-pill {
    padding: 4px 10px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-2);
    font-weight: 600;
    transition: all .15s;
}
.level-pill:hover { border-color: var(--brand-500); }
.level-pill.active {
    background: var(--brand-600);
    color: #fff;
    border-color: var(--brand-600);
}

/* photo upload */
.photo-box {
    border: 1.5px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    background: var(--surface-2);
    margin-bottom: 14px;
}
.photo-box img {
    width: 110px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
    margin: 0 auto 10px;
    box-shadow: var(--shadow-sm);
}
.photo-box .photo-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.photo-box button, .photo-box a {
    padding: 7px 12px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    display: inline-block;
}
.photo-box button:hover, .photo-box a:hover { border-color: var(--brand-500); color: var(--brand-700); }
.photo-box .btn-cam {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    color: #fff !important;
    border-color: var(--brand-700);
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.btn {
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}
.btn:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn-primary {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    color: #fff;
    border-color: var(--brand-700);
    box-shadow: 0 4px 10px rgba(8,145,178,0.25);
}
.btn-primary:hover { filter: brightness(1.05); color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: #fef2f2; }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ============================================================
   PREVIEW
============================================================ */
.preview-wrap { position: sticky; top: 64px; }
@media (max-width: 980px) { .preview-wrap { position: static; } }

.preview-toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}
.preview-toolbar .group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.preview-toolbar .group-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}
.tpl-btn, .color-btn {
    padding: 6px 11px;
    border: 1.5px solid var(--border-2);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
}
.tpl-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.color-btn { padding: 3px; width: 26px; height: 26px; border-radius: 50%; }
.color-btn .swatch { width: 100%; height: 100%; border-radius: 50%; display: block; }
.color-btn.active { border-color: var(--text); transform: scale(1.1); }

.preview-frame {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}
@media (max-width: 980px) { .preview-frame { max-height: none; } }

/* CV paper */
.cv-paper {
    background: #fff;
    width: 100%;
    max-width: 794px;
    min-height: 1123px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    color: #0f172a;
}
.cv-paper[dir="rtl"] { text-align: right; }

/* ============================================================
   TEMPLATE 1: MODERN
============================================================ */
.cv-paper.tpl-modern {
    font-family: var(--font-modern);
    padding: 48px 50px 56px;
}
.tpl-modern .cv-head {
    display: flex;
    gap: 24px;
    align-items: center;
    padding-bottom: 22px;
    margin-bottom: 24px;
    border-bottom: 4px solid var(--cv-accent, var(--brand-600));
}
.tpl-modern[dir="rtl"] .cv-head { flex-direction: row-reverse; }
.tpl-modern .cv-photo {
    width: 130px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.tpl-modern .cv-name {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}
.tpl-modern .cv-job {
    font-size: 17px;
    color: var(--cv-accent, var(--brand-600));
    font-weight: 600;
    margin: 0 0 14px 0;
}
.tpl-modern .cv-contact {
    display: flex; flex-wrap: wrap; gap: 12px 16px;
    font-size: 12.5px; color: #475569;
}
.tpl-modern .cv-section-title {
    font-size: 13px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--cv-accent, var(--brand-600));
    margin: 22px 0 12px 0; padding-bottom: 4px;
    border-bottom: 1.5px solid #e5e7eb;
}
.tpl-modern .cv-item {
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
}
.tpl-modern[dir="rtl"] .cv-item { grid-template-columns: 1fr 120px; }
.tpl-modern .cv-date { font-size: 12px; color: #64748b; font-weight: 600; }
.tpl-modern .cv-item-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.tpl-modern .cv-item-sub { font-size: 13px; color: #475569; margin-bottom: 6px; font-weight: 500; }
.tpl-modern .cv-item-desc { font-size: 13px; color: #334155; line-height: 1.6; white-space: pre-wrap; }
.tpl-modern .cv-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.tpl-modern .cv-skill {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; font-size: 13px;
}
.tpl-modern .cv-skill-bar {
    flex: 1; height: 5px; background: #e5e7eb; border-radius: 3px; overflow: hidden;
}
.tpl-modern .cv-skill-bar > span {
    display: block; height: 100%;
    background: var(--cv-accent, var(--brand-600));
    border-radius: 3px;
}
.tpl-modern .cv-summary { font-size: 14px; line-height: 1.7; color: #334155; }

/* ============================================================
   TEMPLATE 2: CLASSIC (serif)
============================================================ */
.cv-paper.tpl-classic {
    font-family: var(--font-serif);
    padding: 56px 64px;
    color: #1f2937;
}
.cv-paper.tpl-classic[lang="ar"],
.cv-paper.tpl-classic[dir="rtl"] {
    font-family: var(--font-ar);
}
.tpl-classic .cv-head { text-align: center; margin-bottom: 28px; }
.tpl-classic .cv-photo {
    width: 110px; height: 140px;
    object-fit: cover; border-radius: 4px;
    margin: 0 auto 14px; display: block;
    border: 1px solid #d1d5db;
}
.tpl-classic .cv-name {
    font-size: 32px; font-weight: 700;
    letter-spacing: 2.5px; text-transform: uppercase;
    margin: 0 0 6px 0; font-family: var(--font-display);
}
.tpl-classic .cv-job {
    font-size: 15px; font-style: italic;
    margin: 0 0 12px 0; color: #4b5563;
}
.tpl-classic .cv-contact {
    font-size: 12px; color: #4b5563;
    display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.tpl-classic .cv-section-title {
    text-align: center;
    border-top: 1px solid #111; border-bottom: 1px solid #111;
    padding: 5px 0; margin: 26px 0 16px;
    font-weight: 700; text-transform: uppercase;
    letter-spacing: 3px; font-size: 12.5px;
    font-family: var(--font-modern);
}
.tpl-classic .cv-item { margin-bottom: 18px; }
.tpl-classic .cv-item-head {
    display: flex; justify-content: space-between;
    align-items: baseline; margin-bottom: 2px;
}
.tpl-classic .cv-item-title { font-weight: 700; font-size: 15px; }
.tpl-classic .cv-date { font-size: 12px; color: #6b7280; font-style: italic; }
.tpl-classic .cv-item-sub { font-style: italic; font-size: 14px; color: #4b5563; margin-bottom: 6px; }
.tpl-classic .cv-item-desc { font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; }
.tpl-classic .cv-summary { font-size: 14.5px; line-height: 1.75; text-align: justify; }
.tpl-classic .cv-skill { font-size: 13.5px; margin-bottom: 4px; }
.tpl-classic .cv-skill-level { color: #6b7280; font-style: italic; font-size: 12px; margin-left: 6px; }
[dir="rtl"] .tpl-classic .cv-skill-level { margin-left: 0; margin-right: 6px; }

/* ============================================================
   TEMPLATE 3: SIDEBAR
============================================================ */
.cv-paper.tpl-sidebar {
    font-family: var(--font-ui);
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 1123px;
    padding: 0;
}
.tpl-sidebar[dir="rtl"] { grid-template-columns: 1fr 270px; }
.tpl-sidebar .cv-side {
    background: var(--cv-accent-dark, #0f172a);
    color: #fff;
    padding: 40px 26px;
}
.tpl-sidebar .cv-photo {
    width: 160px; height: 160px;
    border-radius: 50%; object-fit: cover;
    display: block; margin: 0 auto 22px;
    border: 4px solid rgba(255,255,255,0.2);
}
.tpl-sidebar .cv-side-name { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.tpl-sidebar .cv-side-job {
    font-size: 12.5px; color: var(--cv-accent-light, #67e8f9);
    text-align: center; margin: 0 0 22px;
    text-transform: uppercase; letter-spacing: 1px;
}
.tpl-sidebar .cv-side-title {
    font-size: 11.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--cv-accent-light, #67e8f9);
    margin: 20px 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.tpl-sidebar .cv-side-text { font-size: 12.5px; color: rgba(255,255,255,0.9); margin-bottom: 5px; word-break: break-word; }
.tpl-sidebar .cv-skill-side { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.tpl-sidebar .cv-skill-side-name { font-size: 12.5px; }
.tpl-sidebar .cv-skill-bar { height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; }
.tpl-sidebar .cv-skill-bar > span { display: block; height: 100%; background: var(--cv-accent-light, #67e8f9); border-radius: 2px; }
.tpl-sidebar .cv-main { padding: 40px 34px; }
.tpl-sidebar .cv-section-title {
    font-size: 15px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--cv-accent, var(--brand-700));
    margin: 0 0 14px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--cv-accent, var(--brand-700));
}
.tpl-sidebar .cv-section-title + .cv-section-title { margin-top: 24px; }
.tpl-sidebar .cv-item { margin-bottom: 16px; }
.tpl-sidebar .cv-item-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tpl-sidebar .cv-item-title { font-weight: 700; font-size: 14.5px; }
.tpl-sidebar .cv-date { font-size: 12px; color: #6b7280; font-weight: 600; }
.tpl-sidebar .cv-item-sub { font-size: 13px; color: var(--cv-accent, var(--brand-700)); margin-bottom: 6px; font-weight: 600; }
.tpl-sidebar .cv-item-desc { font-size: 13px; color: #334155; line-height: 1.6; white-space: pre-wrap; }
.tpl-sidebar .cv-summary { font-size: 13.5px; line-height: 1.65; color: #334155; }

/* ============================================================
   TEMPLATE 4: MINIMAL
============================================================ */
.cv-paper.tpl-minimal {
    font-family: var(--font-light);
    padding: 60px;
}
.tpl-minimal .cv-head { margin-bottom: 30px; }
.tpl-minimal .cv-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; }
.tpl-minimal .cv-name { font-size: 38px; font-weight: 300; margin: 0; letter-spacing: -1px; }
.tpl-minimal .cv-job {
    font-size: 14px; color: var(--cv-accent, var(--brand-600));
    font-weight: 500; margin: 4px 0 14px;
    text-transform: uppercase; letter-spacing: 2.5px;
}
.tpl-minimal .cv-contact { display: flex; gap: 16px; font-size: 12.5px; color: #64748b; flex-wrap: wrap; }
.tpl-minimal .cv-section-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 3.5px;
    color: #94a3b8; margin: 30px 0 14px;
}
.tpl-minimal .cv-item { margin-bottom: 18px; }
.tpl-minimal .cv-item-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.tpl-minimal .cv-item-title { font-weight: 600; font-size: 15px; }
.tpl-minimal .cv-date { font-size: 12px; color: #94a3b8; }
.tpl-minimal .cv-item-sub { font-size: 13px; color: #64748b; margin-bottom: 6px; }
.tpl-minimal .cv-item-desc { font-size: 13px; line-height: 1.7; color: #334155; white-space: pre-wrap; font-weight: 300; }
.tpl-minimal .cv-summary { font-size: 14px; line-height: 1.75; color: #334155; font-weight: 300; }
.tpl-minimal .cv-skill { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.tpl-minimal .cv-skill-level { color: #94a3b8; font-size: 12px; }

/* ============================================================
   TEMPLATE 5: EXECUTIVE
============================================================ */
.cv-paper.tpl-executive {
    font-family: var(--font-modern);
    padding: 0;
    color: #1a202c;
}
.tpl-executive .cv-head {
    background: linear-gradient(135deg, var(--cv-accent-dark, #0f172a), var(--cv-accent, var(--brand-700)));
    color: #fff;
    padding: 48px 60px 38px;
    position: relative;
}
.tpl-executive .cv-head::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 8px;
    background: var(--cv-accent-light, var(--gold-500));
}
.tpl-executive .cv-head-inner {
    display: flex;
    gap: 28px;
    align-items: center;
}
.tpl-executive[dir="rtl"] .cv-head-inner { flex-direction: row-reverse; }
.tpl-executive .cv-photo {
    width: 130px; height: 160px;
    object-fit: cover;
    border-radius: 6px;
    border: 3px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.tpl-executive .cv-name {
    font-size: 38px; font-weight: 800;
    margin: 0 0 4px; letter-spacing: -0.5px;
    line-height: 1.05;
}
.tpl-executive .cv-job {
    font-size: 16px; font-weight: 500;
    color: var(--cv-accent-light, var(--gold-400));
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}
.tpl-executive .cv-contact {
    display: flex; flex-wrap: wrap; gap: 10px 18px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.9);
}
.tpl-executive .cv-body { padding: 36px 60px 50px; }
.tpl-executive .cv-section-title {
    font-size: 14px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--cv-accent-dark, #0f172a);
    margin: 24px 0 14px;
    padding-bottom: 6px;
    border-bottom: 2.5px solid var(--cv-accent-light, var(--gold-500));
    display: inline-block;
}
.tpl-executive .cv-item { margin-bottom: 18px; padding-left: 16px; border-left: 2px solid #e5e7eb; position: relative; }
.tpl-executive[dir="rtl"] .cv-item { padding-left: 0; padding-right: 16px; border-left: none; border-right: 2px solid #e5e7eb; }
.tpl-executive .cv-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--cv-accent, var(--brand-700));
    box-shadow: 0 0 0 3px #fff;
}
.tpl-executive[dir="rtl"] .cv-item::before { left: auto; right: -7px; }
.tpl-executive .cv-item-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tpl-executive .cv-item-title { font-weight: 700; font-size: 15px; color: #1a202c; }
.tpl-executive .cv-date {
    font-size: 11.5px; color: var(--cv-accent, var(--brand-700));
    font-weight: 700;
    background: var(--cv-accent-light, rgba(245,158,11,0.15));
    padding: 2px 9px; border-radius: 999px;
    white-space: nowrap;
}
.tpl-executive .cv-item-sub { font-size: 13px; color: #475569; margin-bottom: 6px; font-weight: 500; }
.tpl-executive .cv-item-desc { font-size: 13px; color: #334155; line-height: 1.65; white-space: pre-wrap; }
.tpl-executive .cv-summary {
    font-size: 14px; line-height: 1.75;
    color: #1a202c;
    padding: 16px 20px;
    background: var(--cv-accent-soft, #f8fafc);
    border-left: 4px solid var(--cv-accent, var(--brand-700));
    border-radius: 4px;
}
.tpl-executive[dir="rtl"] .cv-summary { border-left: none; border-right: 4px solid var(--cv-accent, var(--brand-700)); }
.tpl-executive .cv-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.tpl-executive .cv-skill { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding-left: 0; }
.tpl-executive .cv-skill::before { display: none; }
.tpl-executive .cv-skill-bar { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.tpl-executive .cv-skill-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--cv-accent, var(--brand-700)), var(--cv-accent-light, var(--gold-500)));
    border-radius: 3px;
}

/* ============================================================
   COLOR THEMES
============================================================ */
.cv-paper[data-color="teal"]   { --cv-accent: #0891b2; --cv-accent-dark: #164e63; --cv-accent-light: #67e8f9; --cv-accent-soft: #ecfeff; }
.cv-paper[data-color="indigo"] { --cv-accent: #4f46e5; --cv-accent-dark: #312e81; --cv-accent-light: #a5b4fc; --cv-accent-soft: #eef2ff; }
.cv-paper[data-color="rose"]   { --cv-accent: #be123c; --cv-accent-dark: #4c0519; --cv-accent-light: #fda4af; --cv-accent-soft: #fff1f2; }
.cv-paper[data-color="slate"]  { --cv-accent: #334155; --cv-accent-dark: #0f172a; --cv-accent-light: #94a3b8; --cv-accent-soft: #f1f5f9; }
.cv-paper[data-color="forest"] { --cv-accent: #047857; --cv-accent-dark: #064e3b; --cv-accent-light: #6ee7b7; --cv-accent-soft: #ecfdf5; }
.cv-paper[data-color="gold"]   { --cv-accent: #b45309; --cv-accent-dark: #422006; --cv-accent-light: #fbbf24; --cv-accent-soft: #fef3c7; }

/* ============================================================
   ANSCHREIBEN (Cover Letter)
============================================================ */
.ans-paper {
    background: #fff;
    width: 100%;
    max-width: 794px;
    min-height: 1123px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    color: #1a202c;
    padding: 50px 60px 60px;
    font-family: var(--font-modern);
    font-size: 14px;
    line-height: 1.65;
}
.ans-paper[dir="rtl"] { text-align: right; font-family: var(--font-ar); }

.ans-sender {
    text-align: right;
    margin-bottom: 28px;
    font-size: 11.5px;
    color: #475569;
    line-height: 1.5;
}
[dir="rtl"] .ans-sender { text-align: left; }
.ans-sender strong { color: #1a202c; font-weight: 700; }

.ans-recipient {
    margin-bottom: 56px;
    font-size: 13.5px;
}
.ans-recipient div { margin-bottom: 1px; }

.ans-date {
    text-align: right;
    margin-bottom: 28px;
    font-size: 13px;
    color: #475569;
}
[dir="rtl"] .ans-date { text-align: left; }

.ans-subject {
    font-weight: 700;
    font-size: 14.5px;
    margin-bottom: 28px;
    color: #1a202c;
}

.ans-salutation { margin-bottom: 18px; font-size: 14px; }

.ans-paragraph {
    margin-bottom: 14px;
    text-align: justify;
    white-space: pre-wrap;
}

.ans-closing-line { margin-top: 22px; }
.ans-greeting { margin-top: 28px; margin-bottom: 50px; }
.ans-signature {
    font-weight: 700;
    font-size: 14.5px;
    color: #1a202c;
    margin-bottom: 30px;
}

.ans-attachments {
    margin-top: 16px;
    font-size: 12.5px;
    color: #475569;
}
.ans-attachments strong { display: block; margin-bottom: 4px; color: #1a202c; }

/* Anschreiben modern template */
.ans-paper.ans-modern .ans-sender-bar {
    background: linear-gradient(135deg, var(--ans-accent, var(--brand-700)), var(--ans-accent-dark, var(--brand-900)));
    color: #fff;
    margin: -50px -60px 28px;
    padding: 30px 60px 24px;
}
.ans-paper.ans-modern .ans-sender-bar strong {
    color: #fff;
    font-size: 20px;
    display: block;
    margin-bottom: 6px;
    font-weight: 800;
}
.ans-paper.ans-modern .ans-sender-bar .ans-sender-contact {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
}

.ans-paper.ans-photo-tpl .ans-header {
    display: flex; align-items: center; gap: 20px;
    margin: -50px -60px 28px;
    padding: 30px 60px 24px;
    background: var(--ans-accent-soft, #f8fafc);
    border-bottom: 4px solid var(--ans-accent, var(--brand-700));
}
.ans-paper.ans-photo-tpl .ans-photo {
    width: 90px; height: 110px;
    object-fit: cover; border-radius: 6px;
}
.ans-paper.ans-photo-tpl .ans-header-text strong {
    display: block; font-size: 20px; margin-bottom: 4px;
    color: #1a202c;
}

.ans-paper[data-color] { --ans-accent: var(--cv-accent); --ans-accent-dark: var(--cv-accent-dark); --ans-accent-soft: var(--cv-accent-soft); }

/* ============================================================
   AI SHIMMER + TRANSLATE POPOVER + TOAST
============================================================ */
.ai-shimmer {
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
    border-radius: 4px;
    color: transparent !important;
    pointer-events: none;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.translate-popover {
    position: absolute;
    top: 26px;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 20;
    min-width: 220px;
    display: none;
}
.translate-popover.show { display: block; }
[dir="rtl"] .translate-popover { right: auto; left: 0; }
.translate-popover .pop-title {
    font-size: 11px; color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.translate-popover .pop-langs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.translate-popover .pop-lang {
    padding: 5px 11px;
    border: 1.5px solid var(--border-2);
    background: var(--surface);
    border-radius: 999px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-2);
}
.translate-popover .pop-lang:hover { border-color: var(--brand-500); color: var(--brand-700); }
.translate-popover .pop-actions { display: flex; gap: 6px; justify-content: flex-end; }
.translate-popover .pop-cancel {
    padding: 5px 12px;
    background: var(--surface-2);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
}

.toast-wrap {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--text);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toast-in .3s ease-out;
    transition: opacity .3s;
}
.toast.error   { background: var(--danger); }
.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); }
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   CAMERA STUDIO
============================================================ */
.cam-wrap { max-width: 780px; margin: 0 auto; padding: 20px; }
.cam-card {
    background: var(--surface);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.cam-title { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.cam-subtitle { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

.cam-loading-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; z-index: 10;
    font-size: 14px; font-weight: 600;
}
.cam-spinner {
    width: 38px; height: 38px;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cam-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 35 / 45;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    margin: 14px 0;
}
.cam-stage video,
.cam-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-stage video.mirror { transform: scaleX(-1); }

.cam-overlay { position: absolute; inset: 0; pointer-events: none; }
.cam-overlay::before {
    content: "";
    position: absolute;
    left: 18%; top: 12%;
    width: 64%; height: 70%;
    border: 2.5px dashed rgba(255,255,255,0.75);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
}
.cam-overlay .eye-line {
    position: absolute;
    left: 18%; right: 18%;
    top: 38%; height: 1px;
    background: rgba(255,255,255,0.4);
}
.cam-overlay .chin-line {
    position: absolute;
    left: 30%; right: 30%;
    top: 78%; height: 1px;
    background: rgba(255,255,255,0.4);
}
.cam-overlay .hint-bar {
    position: absolute;
    bottom: 14px; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    min-width: 200px;
}
.cam-overlay .hint-bar.perfect { background: rgba(16,185,129,0.95); }
.cam-overlay .hint-bar.warning { background: rgba(245,158,11,0.95); }
.cam-overlay .hint-bar.error   { background: rgba(239,68,68,0.95); }
.cam-overlay .quality-meter {
    position: absolute;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.65);
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* canvas overlay for face landmarks (debug-style) */
.cam-stage .face-overlay {
    pointer-events: none;
    background: transparent;
}

.fmt-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 12px 0 4px;
}
.fmt-bar button {
    padding: 9px 6px;
    border: 1.5px solid var(--border-2);
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-2);
}
.fmt-bar button.active {
    background: var(--brand-700);
    color: #fff;
    border-color: var(--brand-700);
}

.bg-bar {
    display: flex; gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}
.bg-pill {
    padding: 6px 12px;
    background: var(--surface-2);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    border: 1.5px solid transparent;
    display: inline-flex; align-items: center; gap: 6px;
}
.bg-pill.active {
    background: var(--brand-50);
    color: var(--brand-700);
    border-color: var(--brand-300);
}
.bg-pill .swatch {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    display: inline-block;
}

.cam-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
.cam-actions .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-capture {
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(8,145,178,0.3);
    transition: transform .15s, opacity .15s;
}
.btn-capture:hover:not(:disabled) { transform: translateY(-1px); }
.btn-capture:disabled {
    background: var(--border-2);
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
}
.btn-secondary {
    padding: 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border-2);
    background: var(--surface);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    text-align: center;
    display: inline-block;
}
.btn-secondary:hover { border-color: var(--brand-500); color: var(--brand-700); }

.result-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    background: var(--surface-2);
    padding: 16px;
    border-radius: 12px;
    margin-top: 12px;
}
.result-grid canvas { max-width: 160px; border-radius: 8px; box-shadow: var(--shadow); background: #fff; }
.result-grid .meta { font-size: 13px; color: var(--text-2); }
.result-grid .meta strong { color: var(--text); }

/* ---- Photo editing panel ---- */
.edit-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}
.edit-panel-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-700);
    margin-bottom: 12px;
}
.edit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.edit-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    flex: 0 0 auto;
    min-width: 110px;
}
.edit-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.edit-controls input[type=range] {
    flex: 1;
    accent-color: var(--brand-600);
    height: 28px;
}
/* Sliders hidden by default — quick +/- buttons always visible.
   The "Advanced settings" button reveals the precise sliders. */
.edit-slider { display: none; }
.edit-panel.advanced-open .edit-slider { display: block; }
.btn-advanced-toggle {
    width: 100%;
    padding: 9px;
    border: 1.5px solid var(--brand-300);
    background: var(--brand-50);
    color: var(--brand-700);
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}
.edit-panel.advanced-open .btn-advanced-toggle {
    background: var(--brand-600);
    color: #fff;
    border-color: var(--brand-600);
}
.edit-step {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid var(--border-2);
    background: var(--surface);
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-700);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.edit-step:active { background: var(--brand-50); }
.btn-reset-edit {
    width: 100%;
    padding: 9px;
    border: 1.5px solid var(--border-2);
    background: var(--surface);
    color: var(--text-2);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    margin-top: 4px;
}

/* ---- Print sheet panel ---- */
.sheet-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 14px;
    text-align: center;
}
.sheet-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 12px;
}
.sheet-panel canvas {
    max-width: 100%;
    width: 320px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    background: #fff;
}

.hide { display: none !important; }

@media (max-width: 480px) {
    .cam-wrap { padding: 12px; }
    .cam-card { padding: 16px; border-radius: 14px; }
    .fmt-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   FOOTER
============================================================ */
.foot {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 24px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}
.foot a { font-weight: 700; }
