* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a1a;
    background: #f5f3ff;
    line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────── */
.public-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.logo-tenant {
    font-size: 0.9rem;
    font-weight: 400;
    color: #6b7280;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.job-hero {
    background: linear-gradient(135deg, #4f1fa0 0%, #7c3aed 60%, #8b5cf6 100%);
    padding: 3rem 0 3.5rem;
    position: relative;
    overflow: hidden;
}

.job-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.job-hero::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.job-hero-inner {
    position: relative;
    z-index: 1;
}

.job-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}

.job-hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
    font-family: 'Playfair Display', Georgia, serif;
}

.job-hero-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
}

.job-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.job-hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 500;
    color: white;
}

/* ── Main layout ──────────────────────────────────────────────────── */
.public-main {
    padding: 2rem 0 3rem;
}

.job-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    align-items: start;
}

/* ── Job content ─────────────────────────────────────────────────── */
.job-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.job-details-chips {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ede9fe;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Quill content */
.job-description {
    color: #374151;
    line-height: 1.8;
    font-size: 0.95rem;
}

.quill-content h1,
.quill-content h2,
.quill-content h3 {
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
}

.quill-content h1 { font-size: 1.75rem; }
.quill-content h2 { font-size: 1.5rem; }
.quill-content h3 { font-size: 1.25rem; }

.quill-content p { margin-bottom: 1rem; }

.quill-content ul,
.quill-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.quill-content li { margin-bottom: 0.5rem; }

.quill-content a { color: #7c3aed; text-decoration: underline; }
.quill-content a:hover { color: #6d28d9; }
.quill-content strong { font-weight: 600; color: #1a1a1a; }
.quill-content em { font-style: italic; }

/* ── Application form card ───────────────────────────────────────── */
.application-form-wrapper {
    position: sticky;
    top: 72px;
}

.application-form-card {
    background: white;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.form-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.1rem;
}

.form-subtitle {
    color: #9ca3af;
    font-size: 0.8rem;
    margin: 0;
}

/* ── Alerts ──────────────────────────────────────────────────────── */
.app-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.app-alert--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.app-alert--danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Form internals ──────────────────────────────────────────────── */
.application-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.required { color: #ef4444; }

.optional {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 0.25rem;
}

.form-control {
    padding: 0.65rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    background: #fafafa;
    color: #1a1a1a;
}

.form-control:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
    background: white;
}

.form-control.is-invalid { border-color: #ef4444; }

.form-control.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-help {
    font-size: 0.76rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}

.form-help kbd {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    font-family: monospace;
    font-size: 0.72rem;
    color: #374151;
}

.invalid-feedback {
    display: block;
    font-size: 0.78rem;
    color: #ef4444;
    margin-top: 0.15rem;
}

/* ── Skills tag input ────────────────────────────────────────────── */
.skills-tags-input {
    min-height: 44px;
    padding: 0.35rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    cursor: text;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.skills-tags-input:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
    background: white;
}

.skills-tags-input.is-invalid { border-color: #ef4444; }

.skills-tags-list {
    display: contents;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem 0.2rem 0.65rem;
    border-radius: 99px;
    white-space: nowrap;
    line-height: 1.4;
}

.skill-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: #7c3aed;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.1s;
}

.skill-chip button:hover { opacity: 1; }

.skills-typing-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    font-family: inherit;
    color: #1a1a1a;
    min-width: 120px;
    flex: 1;
    padding: 0.2rem 0.25rem;
}

.skills-suggestions {
    display: none;
    position: absolute;
    z-index: 50;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    top: calc(100% + 4px);
    left: 0;
}

.form-group {
    position: relative;
}

.skill-suggestion-item {
    padding: 0.55rem 0.875rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
}

.skill-suggestion-item:hover {
    background: #f5f3ff;
    color: #6d28d9;
}

.skill-suggestion-item strong {
    color: #7c3aed;
    font-weight: 700;
}

/* ── CV upload zone ──────────────────────────────────────────────── */
.cv-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    background: #fafafa;
}

.cv-upload-zone:hover,
.cv-upload-zone.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.cv-upload-zone.has-file {
    border-color: #7c3aed;
    border-style: solid;
    background: #f5f3ff;
}

.cv-upload-icon {
    font-size: 1.75rem;
    color: #8b5cf6;
    line-height: 1;
}

.cv-upload-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.cv-upload-hint {
    font-size: 0.76rem;
    color: #9ca3af;
}

/* ── Submit button ───────────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 0.25rem;
    letter-spacing: 0.01em;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.public-footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1.25rem 0;
    text-align: center;
    color: #9ca3af;
    font-size: 0.82rem;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .job-layout {
        grid-template-columns: 1fr;
    }

    .application-form-wrapper {
        position: static;
    }
}

@media (max-width: 768px) {
    .job-hero {
        padding: 2rem 0 2.5rem;
    }

    .job-hero-title {
        font-size: 1.65rem;
    }

    .job-hero-meta {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    .public-main {
        padding: 1.25rem 0 2rem;
    }

    .job-content,
    .application-form-card {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
