/* Explain: Styles for UI elements like buttons, forms, notices, resume preview, header, and results sections. */
/* ---------- Header ---------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    max-width: 1180px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.7rem;
}

.brand-mark {
    display: inline-flex;
    width: 2.4rem;
    height: 2.4rem;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 1rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-text strong {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-sub {
    color: var(--text-muted);
    font-size: 0.72rem;
}

@media (max-width: 639px) {
    .brand-sub {
        display: none;
    }
}

.nav-links {
    display: none;
    align-items: center;
    gap: 1.35rem;
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 200ms ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.icon-button {
    display: inline-flex;
    min-height: 2.6rem;
    min-width: 2.6rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--border-strong);
}

.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    overflow-y: auto;
    background: var(--background-color);
}

.nav-mobile-link {
    display: flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 600;
}

.nav-mobile-link:hover {
    background: var(--surface-muted);
}

.nav-mobile-link i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

/* ---------- Buttons ---------- */

.btn-solid,
.btn-soft,
.btn-line {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.btn-solid {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-solid:hover {
    background: var(--primary-hover);
}

.btn-soft {
    background: var(--primary-soft);
    border-color: #DBEAFE;
    color: var(--primary-dark);
}

.btn-soft:hover {
    background: #DBEAFE;
}

.btn-line {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-line:hover {
    border-color: var(--border-strong);
    background: var(--surface-muted);
}

.btn-link {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-color);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
}

.btn-link:hover {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
}

.btn-solid[disabled],
.btn-soft[disabled],
.btn-line[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-sm {
    min-height: 2.35rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.83rem;
}

/* ---------- Panels and headings ---------- */

.panel {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--surface-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.panel-compact {
    padding: 1.15rem;
}

.empty-block {
    text-align: center;
}

.card-icon {
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-color);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

.card-note {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.7;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--primary-color);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-title {
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.16;
}

.section-lead {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
}

.step-badge {
    display: inline-flex;
    width: 1.9rem;
    height: 1.9rem;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

/* ---------- Forms ---------- */

.field {
    display: block;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-color);
    font-size: 0.86rem;
    font-weight: 600;
}

.field-hint {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.field textarea,
.field input,
.field select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    color: var(--text-color);
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.65;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.field textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.field textarea::placeholder,
.field input::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

.field textarea:focus,
.field input:focus,
.field select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    outline: none;
}

.field.has-error textarea,
.field.has-error input {
    border-color: var(--danger-color);
}

.field-counter {
    margin: 0.3rem 0 0;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: right;
    transition: color 200ms ease;
}

.field-counter.is-near {
    color: var(--warning-color);
}

.field-counter.is-over {
    color: var(--danger-color);
    font-weight: 600;
}

.field-error {
    margin: 0.35rem 0 0;
    color: var(--danger-color);
    font-size: 0.78rem;
    font-weight: 500;
}

.consent {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.65;
    cursor: pointer;
}

.consent input {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
    margin-top: 0.2rem;
    accent-color: var(--primary-color);
}

.consent strong {
    color: var(--text-color);
}

.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    background: var(--surface-color);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 200ms ease;
    outline: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
    border-color: var(--primary-color);
    background: var(--primary-soft);
}

.dropzone-icon {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.dropzone-text {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.dropzone-hint {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.import-block {
    display: grid;
    gap: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 1rem;
}

.import-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: var(--text-color);
    font-size: 0.88rem;
    font-weight: 600;
}

.import-title i {
    color: var(--primary-color);
}

.file-trigger {
    position: relative;
    display: grid;
    width: 100%;
}

.file-input-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

.file-status {
    display: none;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 0.75rem;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.file-status i {
    margin-top: 0.15rem;
}

.file-status.is-loading {
    display: flex;
    background: var(--surface-muted);
    color: var(--text-muted);
}

.file-status.is-success {
    display: flex;
    background: var(--success-soft);
    color: #166534;
}

.file-status.is-error {
    display: flex;
    background: var(--danger-soft);
    color: #991B1B;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ---------- Notices ---------- */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.86rem;
    line-height: 1.65;
}

.notice i {
    margin-top: 0.2rem;
}

.notice-info {
    background: var(--primary-soft);
    border-color: #DBEAFE;
    color: var(--primary-dark);
}

.notice-success {
    background: var(--success-soft);
    border-color: #BBF7D0;
    color: #166534;
}

.notice-warning {
    background: var(--warning-soft);
    border-color: #FDE68A;
    color: #92400E;
}

.notice-error {
    background: var(--danger-soft);
    border-color: #FECACA;
    color: #991B1B;
}

/* ---------- Results ---------- */

.score-panel {
    display: flex;
    flex-direction: column;
}

.score-label {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.score-value {
    margin-top: 0.4rem;
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 7vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

.score-tag {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.meter {
    height: 0.55rem;
    margin-top: 1rem;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}

.meter-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--warning-color);
    transition: width 400ms ease;
}

.meter-fill.is-low {
    background: var(--warning-color);
}

.meter-fill.is-mid {
    background: var(--primary-color);
}

.meter-fill.is-high {
    background: var(--success-color);
}

.check-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.check-item i {
    margin-top: 0.18rem;
}

.check-item.is-ok i {
    color: var(--success-color);
}

.check-item.is-warn i {
    color: var(--warning-color);
}

.check-points {
    flex: none;
    margin-left: auto;
    border-radius: 999px;
    background: var(--surface-muted);
    padding: 0.1rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid;
    border-radius: 999px;
    padding: 0.32rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.chip-found {
    background: var(--success-soft);
    border-color: #BBF7D0;
    color: #166534;
}

.chip-missing {
    background: var(--warning-soft);
    border-color: #FDE68A;
    color: #92400E;
}

.empty-inline {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.suggestion-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggestion-list li {
    display: flex;
    gap: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 0.8rem 0.95rem;
    color: var(--text-color);
    font-size: 0.87rem;
    line-height: 1.7;
}

.suggestion-list i {
    margin-top: 0.2rem;
    color: var(--primary-color);
}

.plain-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.7;
}

.plain-list li {
    position: relative;
    padding-left: 1.15rem;
}

.plain-list li::before {
    content: "";
    position: absolute;
    top: 0.62rem;
    left: 0;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--primary-color);
}

.results-prompts {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-muted);
    padding: 0.85rem 1rem;
}

.results-prompts-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.55rem;
    color: var(--text-color);
    font-size: 0.82rem;
    font-weight: 600;
}

.results-prompts-title i {
    color: var(--primary-color);
}

.results-prompts .plain-list {
    gap: 0.4rem;
}

.storage-status {
    border-radius: 10px;
    background: var(--surface-muted);
    padding: 0.7rem 0.85rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

/* ---------- Keyword selection ---------- */

.keyword-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.keyword-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-muted);
    padding: 0.55rem 0.8rem;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
}

.keyword-label:hover {
    border-color: var(--border-strong);
}

.keyword-label input {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
    accent-color: var(--primary-color);
}

.keyword-controls {
    display: grid;
    gap: 0.8rem;
}

.keyword-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.confirm-line {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 0.75rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
    cursor: pointer;
}

.confirm-line input {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
    margin-top: 0.15rem;
    accent-color: var(--primary-color);
}

.resume-section-pending h2 {
    border-bottom-color: #FDE68A;
    color: var(--warning-color);
}

.resume-pending-note {
    margin-bottom: 0.6rem;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    background: var(--warning-soft);
    padding: 0.55rem 0.75rem;
    color: #92400E;
    font-size: 0.8rem;
    line-height: 1.6;
}

/* ---------- Resume preview ---------- */

.preview-label {
    margin: 0 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.preview-note {
    margin: 0.85rem 0 0;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.6;
}

.resume-page {
    max-width: 820px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #ffffff;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    color: #0F172A;
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.6;
}

.resume-head {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.9rem;
}

.resume-name {
    color: #0B1220;
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.resume-contact {
    margin-top: 0.5rem;
    color: #334155;
    font-size: 0.85rem;
    word-break: break-word;
}

.resume-contact-item {
    display: inline-block;
}

.resume-contact-item:not(:last-child)::after {
    content: " • ";
    color: #94A3B8;
}

.resume-section {
    margin-top: 1.4rem;
}

.resume-section h2 {
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3rem;
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.resume-item {
    margin-bottom: 0.95rem;
}

.resume-item:last-child {
    margin-bottom: 0;
}

.resume-item-title {
    margin-top: 0.6rem;
    color: #0B1220;
    font-size: 0.95rem;
    font-weight: 600;
}

.resume-item-title:first-child {
    margin-top: 0;
}

.resume-meta {
    margin-top: 0.15rem;
    color: #64748B;
    font-size: 0.82rem;
}

.resume-text {
    margin-top: 0.35rem;
    white-space: pre-wrap;
}

.resume-list {
    margin: 0.3rem 0 0;
    padding-left: 1.15rem;
}

.resume-list li {
    margin-bottom: 0.2rem;
}

.resume-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-style: italic;
}

/* ---------- Resume source picker ---------- */

.source-picker {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 1rem;
}

.source-picker-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    color: var(--text-color);
    font-size: 0.88rem;
    font-weight: 600;
}

.source-picker-title i {
    color: var(--primary-color);
}

.source-options {
    display: grid;
    gap: 0.6rem;
}

@media (min-width: 640px) {
    .source-options {
        grid-template-columns: 1fr 1fr;
    }
}

.source-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    transition: border-color 200ms ease, background 200ms ease;
}

.source-option:hover {
    border-color: var(--border-strong);
}

.source-option:has(input:checked) {
    border-color: var(--primary-color);
    background: var(--primary-soft);
}

.source-option input {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
    margin-top: 0.15rem;
    accent-color: var(--primary-color);
}

.source-option strong {
    display: block;
    color: var(--text-color);
    font-size: 0.88rem;
}

.source-option span span {
    display: block;
    margin-top: 0.1rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.analyzed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    border-radius: 999px;
    background: var(--primary-soft);
    padding: 0.35rem 0.85rem;
    color: var(--primary-dark);
    font-size: 0.82rem;
}

.analyzed-badge i {
    color: var(--primary-color);
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border-color);
    background: var(--surface-muted);
    padding: 3rem 1.25rem 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.footer-text {
    margin-top: 1rem;
    max-width: 32rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.75;
}

.footer-heading {
    color: var(--text-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.footer-links {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.9rem;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-list {
    display: grid;
    gap: 0.5rem;
    margin: 0.9rem 0 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.7;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

@media (min-width: 640px) {
    .footer-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* ---------- Print ---------- */

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    html,
    body {
        background: #ffffff !important;
    }

    .site-header,
    .site-footer,
    #resumeNotice,
    #resumeEmpty,
    .editor-panel,
    .preview-label,
    .preview-note,
    .resume-section-head,
    .resume-section-pending,
    .section-kicker,
    .section-lead,
    .notice,
    .btn-solid,
    .btn-soft,
    .btn-line {
        display: none !important;
    }

    .page-main {
        padding-top: 0 !important;
    }

    .page-main > section:not(#curriculo) {
        display: none !important;
    }

    #curriculo {
        border: 0 !important;
        background: #ffffff !important;
        padding: 0 !important;
    }

    #curriculo .mx-auto {
        max-width: none !important;
    }

    .resume-workbench {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .preview-side {
        position: static !important;
    }

    .resume-page {
        max-width: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .resume-section,
    .resume-item {
        break-inside: avoid;
    }
}