:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #d7dbe4;
    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(1200px 400px at 50% -100px, #e4e7ff 0%, transparent 70%),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header { padding: 28px 24px 8px; text-align: center; }
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.brand-accent {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.container { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 24px 16px 64px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px -18px rgba(17, 24, 39, 0.25);
}
.card-center { text-align: center; }

.eyebrow {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
}
h1 { margin: 0 0 12px; font-size: 1.7rem; letter-spacing: -0.02em; }
.job-description { color: var(--muted); margin-bottom: 28px; white-space: normal; }
.job-description p { margin: 0 0 14px; }
.job-description p:first-child {
    display: inline-block;
    background: #eef0ff;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.job-description h3 {
    color: var(--text);
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    margin: 24px 0 8px;
}
.job-description ul { margin: 0 0 14px; padding-left: 20px; }
.job-description li { margin: 5px 0; }

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-weight: 400; }
.req { color: var(--error); }

input[type="text"], input[type="email"], select, textarea {
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}
input[type="file"] { font: inherit; color: var(--muted); }
textarea { resize: vertical; }

.field-check label { display: flex; gap: 10px; font-weight: 400; align-items: flex-start; }
.field-check input { margin-top: 4px; flex-shrink: 0; }

.field-error { color: var(--error); font-size: 0.88rem; margin: 6px 0 0; font-weight: 500; }
.disclaimer {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--muted);
}
.disclaimer p { margin: 0; }
.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-weight: 500;
}

.btn {
    display: inline-block;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    padding: 13px 28px;
    border-radius: var(--radius);
    width: 100%;
    transition: opacity 0.15s, transform 0.1s;
    text-decoration: none;
    text-align: center;
}
.btn:hover:not(:disabled) { opacity: 0.92; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-small { width: auto; padding: 8px 20px; }

.success-icon {
    width: 64px; height: 64px;
    margin: 8px auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 2rem;
    line-height: 64px;
}

.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.85rem;
}
.site-footer a { color: var(--muted); }

.cookie-bar {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    max-width: 720px;
    margin: 0 auto;
    background: #111827;
    color: #e5e7eb;
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.4);
    z-index: 50;
}
.cookie-bar[hidden] { display: none; }

.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 1px;
    overflow: hidden;
}
.cookie-bar p { margin: 0; font-size: 0.88rem; }
.cookie-bar a { color: #a5b4fc; }
.cookie-bar .btn { width: auto; }

.mentorship-link { margin: 8px 0 0 30px; font-size: 0.88rem; }
.mentorship-link a { color: var(--accent); font-weight: 600; text-decoration: none; }
.mentorship-link a:hover { text-decoration: underline; }

table.stats { width: 100%; border-collapse: collapse; margin: 12px 0 28px; font-size: 0.92rem; }
table.stats th, table.stats td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.stats th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.toolbar { display: flex; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.toolbar .btn { width: auto; padding: 9px 20px; font-size: 0.9rem; }

@media (max-width: 560px) {
    .card { padding: 26px 18px; border-radius: 16px; }
    .cookie-bar { flex-direction: column; align-items: flex-start; }
}

.inline-form { display: inline; margin: 0; }
.btn-decline {
    background: #fff;
    color: var(--error);
    border: 1px solid var(--error-border);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-decline:hover { background: var(--error-bg); }
.status-new { color: #059669; font-weight: 600; font-size: 0.85rem; }
.status-declined { color: var(--error); font-weight: 600; font-size: 0.85rem; }
.msg-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 18px;
}

.container-wide { max-width: 1100px; }
.table-scroll { overflow-x: auto; }

.review-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.review-counter { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.review-arrows { margin-left: auto; display: flex; gap: 8px; }
.btn-ghost { background: var(--border); color: var(--muted); cursor: default; }
.review-grid { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
.review-meta { color: var(--muted); line-height: 1.9; }
.review-h3 { font-size: 0.95rem; margin: 22px 0 8px; }
.review-motivation {
    margin: 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    max-height: 220px;
    overflow-y: auto;
}
.review-save { margin-top: 10px; }
.review-decline { margin-top: 26px; }
.cv-frame {
    width: 100%;
    height: 78vh;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}
@media (max-width: 900px) {
    .review-grid { grid-template-columns: 1fr; }
    .cv-frame { height: 70vh; }
}

.cv-frame { overflow-y: auto; padding: 12px; }
.cv-page { display: block; width: 100%; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(17, 24, 39, 0.12); border-radius: 4px; }
.cv-loading, .cv-error { padding: 12px; }
.cv-open { text-align: right; margin: 8px 4px 0; }

a.brand { text-decoration: none; color: var(--text); }
.job-list { display: grid; gap: 14px; margin-top: 20px; }
.job-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 22px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.job-card:hover { border-color: var(--accent); box-shadow: 0 6px 20px -12px rgba(79, 70, 229, 0.5); }
.job-card h2 { margin: 0 0 4px; font-size: 1.12rem; }
.job-card-meta { margin: 0 0 10px; color: var(--muted); font-size: 0.88rem; }
.job-card-cta { color: var(--accent); font-weight: 700; font-size: 0.9rem; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin: 4px 0 20px; }
.tab {
    padding: 9px 20px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.tab:hover { color: var(--text); background: #f3f4f8; }
.tab-active { color: var(--accent); border-bottom-color: var(--accent); }

.btn-invite {
    background: #fff;
    color: #059669;
    border: 1px solid #a7f3d0;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-invite:hover { background: #ecfdf5; }
.status-interview { color: #b45309; font-weight: 600; font-size: 0.85rem; }
.status-interview_failed { color: var(--error); font-weight: 600; font-size: 0.85rem; }
.actions-cell { white-space: nowrap; }
.actions-cell .inline-form { margin-right: 6px; }
.review-actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }

.portfolio-file { margin-top: 8px; }

.company-badge {
    display: inline-block;
    background: #fff7ed;
    color: #b45309;
    border: 1px solid #fed7aa;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 10px;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 8px;
}
.btn-logout { margin-left: auto; background: #6b7280; }

.closed-badge {
    display: inline-block;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 6px;
}
