/* =====================================================================
   Nefinex — "Create AI Resume" page  (/ai-resume)
   View: resources/views/front/ai_resume/index.blade.php
   All classes start with .nxr so nothing on the existing site is affected.
   ===================================================================== */

.nxr {
    --nxr-blue: #1f86ef;
    --nxr-blue-d: #1468c2;
    --nxr-ink: #1b2336;
    --nxr-text: #202124;
    --nxr-muted: #667085;
    --nxr-line: #e3e8f0;
    --nxr-soft: #f4f7fc;
    --nxr-violet: #7c5cff;
    --nxr-ok: #12a150;
    --nxr-warn: #e08a00;
    --nxr-bad: #e5484d;
    --nxr-top: 96px;               /* height of the site's sticky menu bar */
    position: relative;
    padding: 46px 0 70px;
    background:
        radial-gradient(900px 420px at 12% 0%, rgba(31, 134, 239, .13), transparent 70%),
        radial-gradient(700px 380px at 92% 8%, rgba(124, 92, 255, .12), transparent 70%),
        linear-gradient(180deg, #eef3fb 0%, #f7f9fd 55%, #ffffff 100%);
    color: var(--nxr-text);
    font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
    min-height: 70vh;
}
.nxr *, .nxr *::before, .nxr *::after { box-sizing: border-box; }
.nxr [hidden] { display: none !important; }

/* ---------- 1. Hero ---------- */
.nxr-hero { max-width: 760px; margin: 0 auto 30px; padding: 0 16px; text-align: center; }
.nxr-hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; color: var(--nxr-ink); margin: 14px 0 10px; line-height: 1.15; }
.nxr-hero h1 span {
    background: linear-gradient(90deg, var(--nxr-blue), var(--nxr-violet));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nxr-hero p { font-size: 17px; color: #475467; margin: 0 auto; max-width: 600px; }
.nxr-hero-tag {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    color: var(--nxr-blue-d); background: rgba(31, 134, 239, .1); border: 1px solid rgba(31, 134, 239, .25);
    padding: 5px 12px; border-radius: 999px;
}
.nxr-hero-note { margin-top: 14px; font-size: 13px; color: var(--nxr-muted); }
.nxr-hero-note i { color: var(--nxr-ok); margin-right: 4px; }

.nxr-hero-orb { position: relative; width: 64px; height: 64px; margin: 0 auto 6px; }
.nxr-hero-orb span {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg, var(--nxr-blue), var(--nxr-violet), #21c8f6, var(--nxr-blue));
    filter: blur(.3px); animation: nxr-spin 6s linear infinite;
}
.nxr-hero-orb span:nth-child(2) { inset: 7px; background: radial-gradient(circle at 35% 30%, #ffffff, #cfe5ff 45%, #8ab8ff 100%); animation: nxr-breathe 3s ease-in-out infinite; }
.nxr-hero-orb span:nth-child(3) { inset: -8px; background: radial-gradient(circle, rgba(31, 134, 239, .25), transparent 65%); animation: nxr-breathe 3s ease-in-out infinite reverse; z-index: -1; }
@keyframes nxr-spin { to { transform: rotate(360deg); } }
@keyframes nxr-breathe { 50% { transform: scale(.9); } }

/* ---------- 2. Form card ---------- */
.nxr-card {
    max-width: 920px; margin: 0 auto; background: rgba(255, 255, 255, .92);
    border: 1px solid var(--nxr-line); border-radius: 18px; padding: 26px 30px 24px;
    box-shadow: 0 20px 50px -24px rgba(27, 35, 54, .25);
}
@media (max-width: 991px) { .nxr-card { margin: 0 16px; } }
@media (max-width: 575px) { .nxr-card { padding: 18px 16px; border-radius: 14px; } }

.nxr-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 22px; padding: 0; counter-reset: s; }
.nxr-steps li {
    flex: 1; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 11px;
    background: var(--nxr-soft); color: var(--nxr-muted); font-weight: 700; font-size: 14px; cursor: pointer;
    border: 1px solid transparent; transition: .2s;
}
.nxr-steps li b {
    flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: #fff; border: 1px solid var(--nxr-line); font-size: 13px;
}
.nxr-steps li.is-active { background: #fff; color: var(--nxr-ink); border-color: rgba(31, 134, 239, .45); box-shadow: 0 4px 14px -8px rgba(31, 134, 239, .6); }
.nxr-steps li.is-active b, .nxr-steps li.is-done b { background: var(--nxr-blue); color: #fff; border-color: var(--nxr-blue); }
.nxr-steps li.is-done { color: var(--nxr-ink); }
@media (max-width: 640px) { .nxr-steps li span { display: none; } .nxr-steps li { justify-content: center; } }

.nxr-step { display: none; border: 0; padding: 0; margin: 0; min-width: 0; }
.nxr-step.is-active { display: block; animation: nxr-in .25s ease; }
@keyframes nxr-in { from { opacity: 0; transform: translateY(6px); } }
.nxr-step legend { font-size: 20px; font-weight: 800; color: var(--nxr-ink); margin-bottom: 14px; float: none; width: auto; }
.nxr-hint { color: var(--nxr-muted); font-size: 14px; margin: -6px 0 12px; }

.nxr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 640px) { .nxr-grid { grid-template-columns: 1fr; } }
.nxr-f { display: block; font-size: 14px; font-weight: 700; color: #344054; margin: 0; min-width: 0; }
.nxr-f > input, .nxr-f > select, .nxr-f > textarea, .nxr-f > .nxr-tags, .nxr-f > .nxr-photo-row { display: flex; margin-top: 6px; }
.nxr-f > input, .nxr-f > select, .nxr-f > textarea { display: block; }
.nxr-f--check { display: flex; align-items: flex-end; padding-bottom: 11px; }
.nxr-f--wide, .nxr-f--full { grid-column: 1 / -1; }
@media (min-width: 641px) { .nxr-f--wide { grid-column: span 2; } }
.nxr-f em { color: var(--nxr-bad); font-style: normal; }
.nxr-f small { font-weight: 500; color: var(--nxr-muted); }
.nxr input[type=text], .nxr input[type=email], .nxr input[type=tel], .nxr input[type=url],
.nxr input[type=date], .nxr input[type=month], .nxr input[type=number], .nxr select, .nxr textarea {
    width: 100%; font: inherit; font-weight: 500; font-size: 15px; color: var(--nxr-text);
    background: #fff; border: 1px solid #d0d7e2; border-radius: 10px; padding: 9px 12px; height: auto !important;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.nxr textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.nxr input:focus, .nxr select:focus, .nxr textarea:focus { border-color: var(--nxr-blue); box-shadow: 0 0 0 3px rgba(31, 134, 239, .15); }
.nxr .is-invalid, .nxr .is-invalid:focus { border-color: var(--nxr-bad) !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .12) !important; }

.nxr-photo-row { display: flex; align-items: center; gap: 12px; }
.nxr-photo-thumb {
    width: 52px; height: 62px; border-radius: 8px; background: var(--nxr-soft); border: 1px dashed #c3cede;
    display: grid; place-items: center; color: #9aa6b8; overflow: hidden; flex: none;
}
.nxr-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.nxr-check { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #344054; margin: 0 0 14px; cursor: pointer; }
.nxr-check input { width: 18px; height: 18px; accent-color: var(--nxr-blue); }
.nxr-check--sm { font-size: 13px; margin: 0; font-weight: 600; }

/* repeatable rows (jobs / education) */
.nxr-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.nxr-row { border: 1px solid var(--nxr-line); border-radius: 14px; padding: 14px 16px 16px; background: #fbfcfe; position: relative; }
.nxr-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.nxr-row-head b { font-size: 14px; color: var(--nxr-blue-d); text-transform: uppercase; letter-spacing: .5px; }
.nxr-row .nxr-grid { gap: 12px 16px; }
.nxr-row-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.nxr-row-grid4 { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 12px 16px; }
@media (max-width: 640px) { .nxr-row-grid3, .nxr-row-grid4 { grid-template-columns: 1fr 1fr; } }

/* tags input */
.nxr-tags {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px;
    border: 1px solid #d0d7e2; border-radius: 10px; padding: 6px 8px; background: #fff; cursor: text;
}
.nxr-tags:focus-within { border-color: var(--nxr-blue); box-shadow: 0 0 0 3px rgba(31, 134, 239, .15); }
.nxr-tags input { flex: 1; min-width: 140px; border: 0 !important; box-shadow: none !important; padding: 4px !important; }
.nxr-tag {
    display: inline-flex; align-items: center; gap: 6px; background: #eaf3ff; color: #134e8e; border: 1px solid #cfe2fb;
    border-radius: 7px; padding: 3px 4px 3px 9px; font-size: 13px; font-weight: 700;
}
.nxr-tag button { border: 0; background: transparent; color: #5b7ba3; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 3px; }

/* buttons */
.nxr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    font: inherit; font-weight: 700; font-size: 15px; line-height: 1; white-space: nowrap;
    padding: 12px 20px; border-radius: 11px; border: 1px solid var(--nxr-blue);
    background: var(--nxr-blue); color: #fff; transition: transform .15s, box-shadow .15s, background .15s; text-decoration: none;
}
.nxr-btn:hover { background: var(--nxr-blue-d); color: #fff; box-shadow: 0 8px 18px -10px rgba(31, 134, 239, .9); }
.nxr-btn:active { transform: translateY(1px); }
.nxr-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.nxr-btn--sm { padding: 9px 14px; font-size: 14px; border-radius: 9px; }
.nxr-btn--ghost { background: #fff; color: var(--nxr-ink); border-color: #d0d7e2; }
.nxr-btn--ghost:hover { background: var(--nxr-soft); color: var(--nxr-ink); border-color: #b9c4d4; box-shadow: none; }
.nxr-btn--ai {
    border: 0; color: #fff; background: linear-gradient(100deg, var(--nxr-blue), var(--nxr-violet), #21a3f6, var(--nxr-blue));
    background-size: 300% 100%; animation: nxr-flow 6s ease infinite;
}
.nxr-btn--ai:hover { color: #fff; box-shadow: 0 10px 24px -10px rgba(124, 92, 255, .8); }
.nxr-btn--ai.is-busy { animation-duration: 1.4s; }
@keyframes nxr-flow { 50% { background-position: 100% 0; } }
.nxr-btn--block { width: 100%; }
.nxr-btn--warn { background: var(--nxr-warn); border-color: var(--nxr-warn); }
.nxr-btn--warn:hover { background: #c47800; }
.nxr-link { border: 0; background: none; color: var(--nxr-blue-d); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px; }
.nxr-link:hover { text-decoration: underline; }
.nxr-link--danger { color: var(--nxr-bad); }

.nxr-nav { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--nxr-line); }
.nxr-nav-gap { flex: 1; }
.nxr-error {
    margin-top: 16px; padding: 11px 14px; border-radius: 10px; background: #fff1f1; border: 1px solid #f7caca;
    color: #b42318; font-size: 14px; font-weight: 600;
}

/* ---------- 3. Result: 80 / 20 ---------- */
.nxr-stage[data-stage=result] { padding: 0 18px; }
.nxr-split { display: flex; gap: 18px; align-items: flex-start; max-width: 1800px; margin: 0 auto; }
.nxr-left { flex: 0 0 calc(80% - 9px); min-width: 0; }
.nxr-right { flex: 0 0 calc(20% - 9px); min-width: 0; }
@media (max-width: 991px) {
    .nxr-split { flex-direction: column; }
    .nxr-left, .nxr-right { flex-basis: auto; width: 100%; }
}

.nxr-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--nxr-ink); color: #fff; padding: 10px 14px; border-radius: 14px 14px 0 0;
    position: sticky; top: var(--nxr-top); z-index: 5;
}
.nxr-toolbar-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.nxr-toolbar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nxr-toolbar-title i { color: #ff8a8a; }
.nxr-toolbar-title em { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: linear-gradient(90deg, var(--nxr-blue), var(--nxr-violet)); }
.nxr-toolbar-title em:empty { display: none; }
.nxr-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nxr-toolbar .nxr-btn--ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .22); }
.nxr-toolbar .nxr-btn--ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.nxr-toolbar .nxr-btn--warn { background: var(--nxr-warn); border-color: var(--nxr-warn); }

.nxr-viewer {
    background: #525a68; border-radius: 0 0 14px 14px; padding: 22px; min-height: 70vh;
    display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative;
}
@media (max-width: 575px) { .nxr-viewer { padding: 10px; gap: 10px; } }
.nxr-viewer canvas { width: 100%; max-width: 900px; height: auto; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border-radius: 2px; }
.nxr-viewer iframe { width: 100%; height: 80vh; border: 0; background: #fff; }
.nxr-viewer.is-busy::after {
    content: ""; position: absolute; inset: 0; border-radius: 0 0 14px 14px;
    background: linear-gradient(110deg, rgba(82, 90, 104, .55) 30%, rgba(150, 170, 255, .35) 50%, rgba(82, 90, 104, .55) 70%);
    background-size: 250% 100%; animation: nxr-sweep 1.3s linear infinite;
}
@keyframes nxr-sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.nxr-paper-skel {
    width: 100%; max-width: 900px; aspect-ratio: 210 / 297; background: #fff; border-radius: 2px; padding: 0 0 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35); overflow: hidden;
}
.nxr-paper-skel div { height: 12px; margin: 22px 7%; border-radius: 6px; background: linear-gradient(90deg, #eef2f7, #e1e8f2, #eef2f7); background-size: 200% 100%; animation: nxr-sweep 1.4s linear infinite; }
.nxr-paper-skel div:first-child { height: 20%; margin: 0 0 30px; border-radius: 0; background: linear-gradient(90deg, #1b2336, #26324d, #1b2336); background-size: 200% 100%; }
.nxr-paper-skel div:nth-child(3) { width: 60%; }
.nxr-paper-skel div:nth-child(5) { width: 45%; }
.nxr-paper-skel p { text-align: center; color: var(--nxr-muted); font-weight: 700; margin-top: 40px; }

/* right panel */
.nxr-right {
    position: sticky; top: calc(var(--nxr-top) + 8px); background: #fff; border: 1px solid var(--nxr-line); border-radius: 14px;
    display: flex; flex-direction: column; max-height: calc(100vh - var(--nxr-top) - 20px); overflow: hidden;
    box-shadow: 0 16px 40px -26px rgba(27, 35, 54, .35);
}
@media (max-width: 991px) { .nxr-right { position: static; max-height: none; } }
.nxr-panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--nxr-line); }
.nxr-panel-head b { display: block; font-size: 15px; color: var(--nxr-ink); }
.nxr-panel-head small { color: var(--nxr-muted); font-size: 12px; font-weight: 600; }
.nxr-mini-orb {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    background: radial-gradient(circle at 35% 30%, #fff, #bcdcff 35%, transparent 60%), conic-gradient(var(--nxr-blue), var(--nxr-violet), #21c8f6, var(--nxr-blue));
    animation: nxr-spin 5s linear infinite;
}
.nxr-analysis { padding: 14px; overflow-y: auto; flex: 1; font-size: 13.5px; }
.nxr-panel-foot { padding: 12px 14px 14px; border-top: 1px solid var(--nxr-line); background: #fbfcfe; text-align: center; }
.nxr-undo { margin-top: 6px; }

.nxr-score { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.nxr-ring {
    --v: 0; --c: var(--nxr-blue); width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: conic-gradient(var(--c) calc(var(--v) * 1%), #e8edf4 0);
}
.nxr-ring span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 800; color: var(--nxr-ink); }
.nxr-score b { display: block; font-size: 15px; color: var(--nxr-ink); }
.nxr-score small { display: block; color: var(--nxr-muted); font-size: 12px; font-weight: 600; }
.nxr-delta { display: inline-block; font-size: 12px; font-weight: 800; color: var(--nxr-ok); background: #e8f7ee; border-radius: 999px; padding: 2px 8px; margin-top: 3px; }
.nxr-verdict { color: #344054; font-weight: 600; margin: 0 0 12px; line-height: 1.45; }

.nxr-h { font-size: 11.5px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--nxr-muted); margin: 16px 0 8px; }
.nxr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nxr-list li { line-height: 1.42; color: #344054; }
.nxr-good li { padding-left: 22px; position: relative; }
.nxr-good li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--nxr-ok); font-weight: 800; }
.nxr-tip { border: 1px solid var(--nxr-line); border-left: 3px solid var(--nxr-warn); border-radius: 9px; padding: 9px 10px; background: #fffdf8; }
.nxr-tip b { display: block; color: var(--nxr-ink); font-size: 13.5px; margin-bottom: 2px; }
.nxr-tip i { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #9a6400; background: #fff3d6; border-radius: 5px; padding: 1px 6px; margin-bottom: 4px; }
.nxr-kw { display: flex; flex-wrap: wrap; gap: 6px; }
.nxr-kw span { font-size: 12px; font-weight: 700; color: #4b3cc4; background: #f0edff; border: 1px solid #ddd5ff; border-radius: 6px; padding: 3px 8px; }
.nxr-changes { background: linear-gradient(135deg, #f1f7ff, #f5f1ff); border: 1px solid #dbe5ff; border-radius: 11px; padding: 11px 12px; margin-bottom: 12px; }
.nxr-changes .nxr-h { margin-top: 0; color: #4b3cc4; }
.nxr-changes li { padding-left: 18px; position: relative; }
.nxr-changes li::before { content: "\2726"; position: absolute; left: 0; color: var(--nxr-violet); }
.nxr-msg { border-radius: 10px; padding: 10px 12px; font-weight: 600; line-height: 1.45; }
.nxr-msg--err { background: #fff1f1; border: 1px solid #f7caca; color: #b42318; word-break: break-word; }
.nxr-msg--info { background: var(--nxr-soft); border: 1px solid var(--nxr-line); color: #344054; }
.nxr-msg .nxr-link { display: block; margin-top: 6px; padding: 0; }

.nxr-thinking { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 6px; text-align: center; color: var(--nxr-muted); font-weight: 700; }
.nxr-thinking .nxr-hero-orb { width: 54px; height: 54px; margin: 0; }
.nxr-shimmer { height: 11px; border-radius: 6px; width: 100%; background: linear-gradient(90deg, #eef2f7, #e1e8f2, #eef2f7); background-size: 200% 100%; animation: nxr-sweep 1.4s linear infinite; }
.nxr-shimmer:nth-child(odd) { width: 80%; }

/* the site's "go to top" button would cover the Improve button on this screen */
body.nxr-on-result .go-top { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .nxr *, .nxr *::before, .nxr *::after { animation: none !important; transition: none !important; }
}
