/* ============================================
   ZimCVs — Main Application Styles
   ============================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    /* Editor UI (Dark Mode) */
    --bg-primary: #0B1120;
    --bg-secondary: #111827;
    --bg-tertiary: #1E293B;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-glass: rgba(15, 23, 42, 0.8);
    --border-color: rgba(148, 163, 184, 0.12);
    --border-focus: rgba(99, 102, 241, 0.5);

    /* Text */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --text-inverse: #0F172A;

    /* Accent — warm violet, not generic AI indigo */
    --accent: #7C3AED;
    --accent-light: #A78BFA;
    --accent-dark: #6D28D9;
    --accent-glow: rgba(124, 58, 237, 0.15);

    /* Status Colors */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;

    /* CV Accent (user-changeable) */
    --cv-accent: #1E3A5F;
    --cv-accent-light: #2d5a8a;
    --cv-accent-text: #ffffff;

    /* Sizes */
    --topbar-height: 56px;
    --editor-width: 420px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Lock scroll when editor is active (set by JS on body) */
body.app-active {
    overflow: hidden;
    height: 100vh;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
}

a {
    color: var(--accent-light);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.topbar__logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar__logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.topbar__logo-icon svg {
    width: 18px;
    height: 18px;
}

.topbar__brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar__brand-accent {
    color: var(--accent-light);
}

.topbar__center {
    display: flex;
    justify-content: center;
}

.topbar__tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.topbar__tab {
    display: none;
    /* Hidden on desktop, shown on mobile */
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.topbar__tab svg {
    width: 16px;
    height: 16px;
}

.topbar__tab--active {
    background: var(--accent);
    color: white;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn--ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.btn--icon {
    padding: 6px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.btn--icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn--sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn--add {
    width: 100%;
    padding: 10px;
    background: var(--accent-glow);
    color: var(--accent-light);
    border: 1px dashed rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-sm);
    justify-content: center;
    font-weight: 500;
}

.btn--add:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent-light);
}

.btn--danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn--danger-outline:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.btn--full {
    width: 100%;
    justify-content: center;
}

.btn--remove {
    padding: 4px;
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition-fast);
}

.btn--remove:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app {
    display: flex;
    height: calc(100vh - var(--topbar-height));
    margin-top: var(--topbar-height);
}

/* ============================================
   EDITOR PANEL
   ============================================ */
.editor {
    width: var(--editor-width);
    min-width: var(--editor-width);
    height: 100%;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 24px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Prevent flex from shrinking children */
    align-items: stretch;
}

.editor__section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
    transition: var(--transition-base);
    flex-shrink: 0;
}

.editor__section:hover {
    border-color: rgba(148, 163, 184, 0.2);
}

.editor__section--danger {
    background: transparent;
    border: none;
    padding: 8px 0 16px;
    flex-shrink: 0;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: default;
    text-align: left;
}

.section-header--collapsible {
    cursor: pointer;
    transition: var(--transition-fast);
}

.section-header--collapsible:hover {
    background: rgba(255, 255, 255, 0.03);
}

.section-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.section-header__icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    flex-shrink: 0;
}

.section-header__icon svg {
    width: 16px;
    height: 16px;
}

.section-header__title {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-header__chevron {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    transition: transform var(--transition-base);
}

.section-header--collapsed .section-header__chevron {
    transform: rotate(-90deg);
}

/* Section Content */
.section-content {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition-slow), opacity var(--transition-base), padding var(--transition-base);
}

.section-content--open {
    max-height: none;
    opacity: 1;
    overflow: visible;
    padding: 0 16px 16px;
}

/* ============================================
   TEMPLATE GRID
   ============================================ */
.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 16px;
}

.template-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.template-card:hover {
    border-color: var(--text-tertiary);
    transform: translateY(-2px);
}

.template-card--active {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.template-card__preview {
    width: 100%;
    aspect-ratio: 3/4;
    background: white;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}

.template-card__name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Template Mini Previews */
.template-mini {
    width: 100%;
    height: 100%;
    display: flex;
}

.template-mini--modern {
    flex-direction: row;
}

.template-mini__sidebar {
    width: 35%;
    background: var(--cv-accent);
}

.template-mini__content {
    flex: 1;
    padding: 8%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.template-mini__line {
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    width: 100%;
}

.template-mini__line--title {
    height: 5px;
    background: #475569;
    margin-bottom: 2px;
}

.template-mini__line--short {
    width: 60%;
}

.template-mini__line--center {
    margin: 0 auto;
    width: 70%;
}

.template-mini__divider {
    height: 1px;
    background: #cbd5e1;
    margin: 4px 0;
}

.template-mini--classic {
    flex-direction: column;
    padding: 8%;
    gap: 3px;
}

.template-mini--elegant {
    flex-direction: column;
}

.template-mini__topbar {
    height: 12%;
    background: var(--cv-accent);
}

.template-mini--elegant .template-mini__line {
    margin: 0 8%;
    width: calc(100% - 16%);
}

.template-mini--elegant .template-mini__line:first-of-type {
    margin-top: 8%;
}

.template-mini--ats {
    flex-direction: column;
    padding: 8%;
    gap: 4px;
}

/* Color Picker */
.color-picker-row {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.color-picker-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

.color-presets {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch--active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--accent);
}

.color-custom {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.color-custom::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-custom::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ============================================
   PHOTO UPLOAD
   ============================================ */
.photo-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.photo-upload__preview {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    gap: 4px;
    transition: var(--transition-fast);
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.photo-upload__preview svg {
    width: 20px;
    height: 20px;
}

.photo-upload__preview:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.photo-upload__preview--has-photo {
    border-style: solid;
    border-color: var(--accent);
}

.photo-upload__preview--has-photo span,
.photo-upload__preview--has-photo svg {
    display: none;
}

/* ============================================
   ITEMS LIST (Experience, Education, etc.)
   ============================================ */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.item-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    position: relative;
    transition: var(--transition-fast);
}

.item-card:hover {
    border-color: rgba(148, 163, 184, 0.25);
}

.item-card:hover .btn--remove {
    opacity: 1;
}

.item-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.item-card__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.item-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.item-card__grid--full {
    grid-template-columns: 1fr;
}

/* Highlights / Bullet Points */
.highlights-section {
    margin-top: 10px;
}

.highlights-section__label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.highlight-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.highlight-row .form-input {
    flex: 1;
    padding: 7px 10px;
    font-size: 0.82rem;
}

.btn--remove-highlight {
    padding: 4px;
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn--remove-highlight:hover {
    color: var(--danger);
    opacity: 1;
}

.btn--remove-highlight svg {
    width: 14px;
    height: 14px;
}

.btn--add-highlight {
    padding: 5px 8px;
    background: transparent;
    color: var(--text-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.btn--add-highlight:hover {
    color: var(--accent-light);
    border-color: var(--accent);
}

.btn--add-highlight svg {
    width: 12px;
    height: 12px;
}

/* Compact items (Skills, Languages) */
.items-list--compact .item-card {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.items-list--compact .form-input {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.items-list--compact .form-group {
    flex: 1;
}

.items-list--compact .btn--remove {
    opacity: 0.5;
    flex-shrink: 0;
}

/* ============================================
   TOGGLE
   ============================================ */
.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle input {
    display: none;
}

.toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 22px;
    transition: var(--transition-fast);
    border: 1px solid var(--border-color);
}

.toggle__slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-tertiary);
    top: 2px;
    left: 2px;
    transition: var(--transition-fast);
}

.toggle input:checked+.toggle__slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle input:checked+.toggle__slider::before {
    transform: translateX(18px);
    background: white;
}

.ref-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ref-toggle__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   PREVIEW PANEL
   ============================================ */
.preview {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
}

.preview__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.preview__zoom {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview__zoom-level {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

.preview__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview__canvas-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 30px;
}

.preview__canvas {
    width: 210mm;
    min-height: 297mm;
    height: fit-content;
    background: white;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    transform-origin: top center;
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

/* ============================================
   CV TEMPLATES — MODERN (Default)
   ============================================ */
.cv {
    width: 100%;
    min-height: 297mm;
    font-family: 'Inter', sans-serif;
    font-size: 9.5pt;
    line-height: 1.4;
    color: #1e293b;
    display: flex;
    align-items: stretch;
}

/* ---- Modern Template ---- */
.cv--modern {
    flex-direction: row;
}

.cv--modern .cv__sidebar {
    width: 35%;
    min-width: 35%;
    background: var(--cv-accent);
    color: var(--cv-accent-text);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.cv--modern .cv__photo-wrapper {
    width: 100%;
    padding: 25px 25px 15px;
    display: flex;
    justify-content: center;
}

.cv--modern .cv__photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.cv--modern .cv__sidebar-content {
    padding: 5px 22px 25px;
    flex: 1;
}

.cv--modern .cv__sidebar-section {
    margin-bottom: 18px;
}

.cv--modern .cv__sidebar-title {
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.95);
}

.cv--modern .cv__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 8.5pt;
    color: rgba(255, 255, 255, 0.85);
    word-break: break-word;
}

.cv--modern .cv__contact-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.8;
}

.cv--modern .cv__skill-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 8.5pt;
    color: rgba(255, 255, 255, 0.85);
}

.cv--modern .cv__skill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.cv--modern .cv__lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 8.5pt;
    color: rgba(255, 255, 255, 0.85);
}

.cv--modern .cv__lang-level {
    font-size: 7.5pt;
    opacity: 0.7;
    font-style: italic;
}

.cv--modern .cv__personal-item {
    font-size: 8.5pt;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
}

.cv--modern .cv__personal-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* Modern — Main Content */
.cv--modern .cv__main {
    flex: 1;
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
}

.cv--modern .cv__name {
    font-size: 20pt;
    font-weight: 800;
    color: var(--cv-accent);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.cv--modern .cv__job-title {
    font-size: 10pt;
    color: #64748b;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

.cv--modern .cv__section {
    margin-bottom: 16px;
}

.cv--modern .cv__section-title {
    font-size: 10.5pt;
    font-weight: 700;
    color: var(--cv-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--cv-accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cv--modern .cv__section-icon {
    width: 16px;
    height: 16px;
    color: var(--cv-accent);
}

.cv--modern .cv__summary {
    font-size: 9pt;
    color: #475569;
    line-height: 1.55;
}

/* Experience & Education Items */
.cv--modern .cv__item {
    margin-bottom: 12px;
}

.cv--modern .cv__item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.cv--modern .cv__item-title {
    font-size: 10pt;
    font-weight: 700;
    color: #1e293b;
}

.cv--modern .cv__item-date {
    font-size: 8pt;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.cv--modern .cv__item-subtitle {
    font-size: 8.5pt;
    color: var(--cv-accent);
    font-weight: 500;
    margin-bottom: 1px;
}

.cv--modern .cv__item-location {
    font-size: 8pt;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 4px;
}

.cv--modern .cv__item-highlights {
    list-style: none;
    padding: 0;
}

.cv--modern .cv__item-highlight {
    font-size: 8.5pt;
    color: #475569;
    padding-left: 14px;
    position: relative;
    margin-bottom: 2px;
    line-height: 1.45;
}

.cv--modern .cv__item-highlight::before {
    content: '•';
    position: absolute;
    left: 2px;
    color: var(--cv-accent);
    font-weight: bold;
}

.cv--modern .cv__item-grade {
    font-size: 8pt;
    color: #64748b;
    margin-top: 2px;
}

/* References */
.cv--modern .cv__ref-note {
    font-size: 8.5pt;
    color: #94a3b8;
    font-style: italic;
}

.cv--modern .cv__ref-item {
    margin-bottom: 8px;
}

.cv--modern .cv__ref-name {
    font-weight: 600;
    font-size: 9pt;
    color: #1e293b;
}

.cv--modern .cv__ref-position {
    font-size: 8pt;
    color: #64748b;
}

.cv--modern .cv__ref-contact {
    font-size: 8pt;
    color: #94a3b8;
}

/* ---- Classic Template ---- */
.cv--classic {
    flex-direction: column;
    padding: 35px 40px;
}

.cv--classic .cv__header-classic {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--cv-accent);
}

.cv--classic .cv__photo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.cv--classic .cv__photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cv-accent);
}

.cv--classic .cv__name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22pt;
    font-weight: 700;
    color: var(--cv-accent);
    letter-spacing: 0.02em;
}

.cv--classic .cv__job-title {
    font-size: 10.5pt;
    color: #64748b;
    margin-top: 2px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cv--classic .cv__contact-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
    font-size: 8.5pt;
    color: #475569;
}

.cv--classic .cv__contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cv--classic .cv__contact-icon {
    width: 12px;
    height: 12px;
    color: var(--cv-accent);
}

.cv--classic .cv__section {
    margin-bottom: 14px;
}

.cv--classic .cv__section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 11pt;
    font-weight: 700;
    color: var(--cv-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.cv--classic .cv__summary {
    font-size: 9pt;
    color: #475569;
    line-height: 1.6;
}

.cv--classic .cv__item {
    margin-bottom: 12px;
}

.cv--classic .cv__item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cv--classic .cv__item-title {
    font-size: 10pt;
    font-weight: 700;
    color: #1e293b;
}

.cv--classic .cv__item-date {
    font-size: 8pt;
    color: #64748b;
}

.cv--classic .cv__item-subtitle {
    font-size: 9pt;
    color: var(--cv-accent);
    font-weight: 500;
}

.cv--classic .cv__item-location {
    font-size: 8pt;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 3px;
}

.cv--classic .cv__item-highlights {
    list-style: none;
    padding: 0;
}

.cv--classic .cv__item-highlight {
    font-size: 8.5pt;
    color: #475569;
    padding-left: 14px;
    position: relative;
    margin-bottom: 2px;
    line-height: 1.45;
}

.cv--classic .cv__item-highlight::before {
    content: '•';
    position: absolute;
    left: 2px;
    color: var(--cv-accent);
}

.cv--classic .cv__item-grade {
    font-size: 8pt;
    color: #64748b;
}

.cv--classic .cv__skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cv--classic .cv__skill-tag {
    padding: 3px 10px;
    font-size: 8pt;
    background: #f1f5f9;
    color: #475569;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
}

.cv--classic .cv__lang-item {
    display: flex;
    gap: 8px;
    font-size: 8.5pt;
    margin-bottom: 3px;
}

.cv--classic .cv__lang-name {
    font-weight: 600;
    color: #1e293b;
}

.cv--classic .cv__lang-level {
    color: #64748b;
}

.cv--classic .cv__ref-note {
    font-size: 8.5pt;
    color: #94a3b8;
    font-style: italic;
}

.cv--classic .cv__personal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 8.5pt;
    color: #475569;
}

.cv--classic .cv__personal-label {
    font-weight: 600;
}

/* ---- Elegant Template ---- */
.cv--elegant {
    flex-direction: column;
}

.cv--elegant .cv__header-elegant {
    background: var(--cv-accent);
    color: white;
    padding: 28px 35px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cv--elegant .cv__photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.cv--elegant .cv__header-info {
    flex: 1;
}

.cv--elegant .cv__name {
    font-size: 20pt;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.cv--elegant .cv__job-title {
    font-size: 10pt;
    font-weight: 300;
    opacity: 0.85;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cv--elegant .cv__contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    font-size: 8pt;
    opacity: 0.85;
}

.cv--elegant .cv__contact-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cv--elegant .cv__contact-icon {
    width: 11px;
    height: 11px;
}

.cv--elegant .cv__body-elegant {
    display: flex;
    flex: 1;
}

.cv--elegant .cv__main-elegant {
    flex: 1;
    padding: 25px 28px;
}

.cv--elegant .cv__aside-elegant {
    width: 35%;
    padding: 25px 22px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
}

.cv--elegant .cv__section {
    margin-bottom: 16px;
}

.cv--elegant .cv__section-title {
    font-size: 10pt;
    font-weight: 700;
    color: var(--cv-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--cv-accent);
}

.cv--elegant .cv__summary {
    font-size: 9pt;
    color: #475569;
    line-height: 1.55;
}

.cv--elegant .cv__item {
    margin-bottom: 12px;
}

.cv--elegant .cv__item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cv--elegant .cv__item-title {
    font-size: 10pt;
    font-weight: 700;
    color: #1e293b;
}

.cv--elegant .cv__item-date {
    font-size: 8pt;
    color: #64748b;
}

.cv--elegant .cv__item-subtitle {
    font-size: 9pt;
    color: var(--cv-accent);
    font-weight: 500;
}

.cv--elegant .cv__item-location {
    font-size: 8pt;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 3px;
}

.cv--elegant .cv__item-highlights {
    list-style: none;
    padding: 0;
}

.cv--elegant .cv__item-highlight {
    font-size: 8.5pt;
    color: #475569;
    padding-left: 14px;
    position: relative;
    margin-bottom: 2px;
    line-height: 1.45;
}

.cv--elegant .cv__item-highlight::before {
    content: '•';
    position: absolute;
    left: 2px;
    color: var(--cv-accent);
}

.cv--elegant .cv__item-grade {
    font-size: 8pt;
    color: #64748b;
}

.cv--elegant .cv__skill-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 8.5pt;
    color: #475569;
    margin-bottom: 5px;
}

.cv--elegant .cv__skill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cv-accent);
    flex-shrink: 0;
}

.cv--elegant .cv__lang-item {
    display: flex;
    justify-content: space-between;
    font-size: 8.5pt;
    margin-bottom: 4px;
}

.cv--elegant .cv__lang-name {
    font-weight: 500;
    color: #1e293b;
}

.cv--elegant .cv__lang-level {
    color: #64748b;
    font-style: italic;
}

.cv--elegant .cv__personal-item {
    font-size: 8.5pt;
    color: #475569;
    margin-bottom: 3px;
}

.cv--elegant .cv__personal-label {
    font-weight: 600;
    color: #1e293b;
}

.cv--elegant .cv__ref-note {
    font-size: 8.5pt;
    color: #94a3b8;
    font-style: italic;
}

/* ---- ATS Template ---- */
.cv--ats {
    flex-direction: column;
    padding: 30px 35px;
    font-family: 'Inter', Arial, sans-serif;
}

.cv--ats .cv__name {
    font-size: 18pt;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.cv--ats .cv__job-title {
    font-size: 10pt;
    color: #4b5563;
    margin-bottom: 6px;
}

.cv--ats .cv__contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 8.5pt;
    color: #4b5563;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d1d5db;
}

.cv--ats .cv__section {
    margin-bottom: 12px;
}

.cv--ats .cv__section-title {
    font-size: 10.5pt;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #d1d5db;
}

.cv--ats .cv__summary {
    font-size: 9pt;
    color: #374151;
    line-height: 1.6;
}

.cv--ats .cv__item {
    margin-bottom: 10px;
}

.cv--ats .cv__item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cv--ats .cv__item-title {
    font-size: 10pt;
    font-weight: 700;
    color: #111827;
}

.cv--ats .cv__item-date {
    font-size: 8pt;
    color: #6b7280;
}

.cv--ats .cv__item-subtitle {
    font-size: 9pt;
    color: #374151;
}

.cv--ats .cv__item-location {
    font-size: 8pt;
    color: #9ca3af;
    margin-bottom: 3px;
}

.cv--ats .cv__item-highlights {
    list-style: disc;
    padding-left: 18px;
}

.cv--ats .cv__item-highlight {
    font-size: 8.5pt;
    color: #374151;
    margin-bottom: 2px;
    line-height: 1.45;
}

.cv--ats .cv__item-grade {
    font-size: 8pt;
    color: #6b7280;
}

.cv--ats .cv__skills-list {
    font-size: 9pt;
    color: #374151;
    line-height: 1.7;
}

.cv--ats .cv__lang-item {
    font-size: 9pt;
    color: #374151;
    margin-bottom: 2px;
}

.cv--ats .cv__personal-row {
    font-size: 9pt;
    color: #374151;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.cv--ats .cv__personal-label {
    font-weight: 600;
}

.cv--ats .cv__ref-note {
    font-size: 9pt;
    color: #6b7280;
    font-style: italic;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.toast {
    padding: 12px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease forwards;
    backdrop-filter: blur(12px);
    max-width: 350px;
}

.toast--success {
    border-left: 3px solid var(--success);
}

.toast--error {
    border-left: 3px solid var(--danger);
}

.toast--info {
    border-left: 3px solid var(--accent);
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast--success svg {
    color: var(--success);
}

.toast--error svg {
    color: var(--danger);
}

.toast--info svg {
    color: var(--accent);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   CV ITEM — Link & Compact
   ============================================ */
.cv__item-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 7.5pt;
    color: var(--cv-accent, #7C3AED);
    margin-bottom: 3px;
    opacity: 0.8;
}

.cv__item-link svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.cv__item--compact {
    margin-bottom: 6px;
}

/* ============================================
   TOPBAR — Home Link & Save Indicator
   ============================================ */
.topbar__logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: opacity 200ms;
}

.topbar__logo-link:hover {
    opacity: 0.8;
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 900px) {
    .topbar__tab {
        display: flex;
    }

    .btn__label {
        display: none;
    }

    .app {
        flex-direction: column;
    }

    .editor {
        width: 100%;
        min-width: unset;
        height: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .preview {
        display: none;
        height: 100%;
    }

    .app--show-preview .editor {
        display: none;
    }

    .app--show-preview .preview {
        display: flex;
    }

    .preview__canvas-wrapper {
        padding: 12px;
    }

    .preview__canvas {
        width: 100%;
        min-height: auto;
    }

    .template-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group--full {
        grid-column: 1;
    }

    .topbar__right .btn span {
        display: none;
    }

    .topbar__right .btn {
        padding: 8px;
    }

    .topbar__right .btn--primary span {
        display: inline;
    }

    :root {
        --editor-width: 100%;
    }
}

@media (max-width: 480px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   AUTH UI — Google Login Button
   ============================================ */
.btn--google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    color: #3c4043;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 10px 20px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn--google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.btn--google:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn--google svg {
    flex-shrink: 0;
}

/* ============================================
   AUTH UI — Landing Nav User Info
   ============================================ */
.landing-nav__auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-nav__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-nav__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.5);
    object-fit: cover;
}

.landing-nav__username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #F1F5F9);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   AUTH UI — Topbar User Info
   ============================================ */
.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.4);
    object-fit: cover;
}

.topbar__username {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #94A3B8);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   OVERLAY — Locked Editor (Free CV used)
   ============================================ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.overlay--active {
    display: flex;
}

.overlay__card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 0 60px rgba(99, 102, 241, 0.15),
        0 25px 50px rgba(0, 0, 0, 0.4);
    animation: overlaySlideIn 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes overlaySlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.overlay__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.overlay__icon svg,
.overlay__icon i {
    width: 32px;
    height: 32px;
}

.overlay__icon--lock {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

.overlay__icon--premium {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1));
    border: 2px solid rgba(251, 191, 36, 0.3);
    color: #FBBF24;
}

.overlay__title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #F1F5F9;
    margin-bottom: 12px;
}

.overlay__desc {
    font-size: 0.95rem;
    color: #94A3B8;
    line-height: 1.6;
    margin-bottom: 16px;
}

.overlay__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #FBBF24;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 20px 0 24px;
}

.overlay__badge svg,
.overlay__badge i {
    width: 18px;
    height: 18px;
}

/* ============================================
   MODAL — Premium Coming Soon
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal--active {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.modal__card {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.97), rgba(15, 23, 42, 0.99));
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 0 80px rgba(99, 102, 241, 0.1),
        0 25px 50px rgba(0, 0, 0, 0.5);
    animation: overlaySlideIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 200ms;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__close:hover {
    color: #F1F5F9;
    background: rgba(255, 255, 255, 0.08);
}

.modal__title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #F1F5F9;
    margin-bottom: 12px;
}

.modal__desc {
    font-size: 0.9rem;
    color: #94A3B8;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal__features {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    padding: 0 8px;
}

.modal__feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #CBD5E1;
}

.modal__feature i,
.modal__feature svg {
    width: 18px;
    height: 18px;
    color: #22C55E;
    flex-shrink: 0;
}

.modal__note {
    font-size: 0.8rem;
    color: #64748B;
    margin-top: 16px;
}

/* ============================================
   RESPONSIVE — Auth UI Mobile
   ============================================ */
@media (max-width: 900px) {
    .landing-nav__username {
        display: none;
    }

    .topbar__username {
        display: none;
    }

    .overlay__card,
    .modal__card {
        padding: 32px 24px;
    }

    .overlay__title,
    .modal__title {
        font-size: 1.35rem;
    }

    /* ── Topbar ── */
    :root {
        --topbar-height: 48px;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar__left {
        gap: 6px;
        flex: 0 1 auto;
    }

    .topbar__logo-link {
        gap: 6px;
    }

    .topbar__logo-link .landing-nav__logo-icon {
        width: 26px;
        height: 26px;
    }

    .topbar__logo-link .landing-nav__logo-icon svg {
        width: 13px;
        height: 13px;
    }

    .topbar__logo-link span {
        font-size: 0.95rem;
    }

    /* Save indicator: hide text, show icon only */
    .topbar__save-indicator {
        font-size: 0.7rem;
        padding: 2px 4px;
        gap: 2px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .topbar__save-indicator .save-indicator__text {
        display: none;
    }

    .topbar__save-indicator svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    /* ── Editor Panel ── */
    .editor {
        padding: 0;
    }

    /* Reliable bottom spacer — padding-bottom gets clipped on Android Chrome
       when the container has height:100% + overflow-y:auto. A pseudo-element
       is treated as real scroll content and always visible. */
    .editor::after {
        content: '';
        display: block;
        min-height: calc(80px + env(safe-area-inset-bottom, 24px));
        flex-shrink: 0;
    }

    .editor__inner {
        padding: 12px;
        gap: 12px;
    }

    .editor__section-header {
        padding: 14px 16px;
    }

    .editor__section-title {
        font-size: 0.85rem;
        gap: 8px;
    }

    .editor__section-title svg {
        width: 16px;
        height: 16px;
    }

    .editor__section-body {
        padding: 14px;
    }

    .form-group label {
        font-size: 0.78rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    /* ── Template Grid ── */
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .template-card {
        padding: 8px;
        border-radius: 8px;
    }

    .template-card__label {
        font-size: 0.7rem;
    }

    /* ── Buttons ── */
    .btn--sm {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .btn--add {
        padding: 10px;
        font-size: 0.8rem;
    }

    /* ── User Auth in topbar ── */
    .topbar__user {
        gap: 6px;
    }

    .topbar__avatar {
        width: 26px;
        height: 26px;
    }

    #btn-sign-out {
        padding: 4px;
    }

    #btn-sign-out svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .btn--google span {
        display: none;
    }

    .btn--google {
        padding: 10px 14px;
    }

    /* ── Topbar: ultra compact ── */
    :root {
        --topbar-height: 44px;
    }

    .topbar {
        padding: 0 8px;
        gap: 4px;
    }

    .topbar__tab {
        font-size: 0.78rem;
        padding: 4px 10px;
    }

    /* ── Editor: tighter on small screens ── */
    .editor__inner {
        padding: 8px;
        gap: 8px;
    }

    .editor__section-header {
        padding: 12px;
    }

    .editor__section-body {
        padding: 10px;
    }

    .form-grid {
        gap: 10px;
    }

    /* ── Preview zoom ── */
    .preview__toolbar {
        padding: 6px 8px;
        gap: 4px;
    }

    .preview__toolbar .btn {
        padding: 4px 8px;
        font-size: 0.72rem;
    }

    /* ── Overlay/Modal: even smaller ── */
    .overlay__card,
    .modal__card {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .overlay__title {
        font-size: 1.2rem;
    }

    .overlay__desc {
        font-size: 0.82rem;
    }

    .overlay__badge {
        font-size: 0.78rem;
        padding: 8px 16px;
    }

    .modal__title {
        font-size: 1.2rem;
    }

    .modal__desc {
        font-size: 0.82rem;
    }

    .modal__features {
        padding: 0;
        gap: 8px;
    }

    .modal__feature {
        font-size: 0.8rem;
        gap: 8px;
    }

    .overlay__icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

    .overlay__icon svg,
    .overlay__icon i {
        width: 26px;
        height: 26px;
    }
}