/*
 * Tsjob PRO — Forms Styles (ts-pro-forms.css)
 * Covers: job submit form, apply form, auth forms, job alerts,
 *         resume builder, profile forms, pricing table.
 * Depends on: ts-pro-global.css
 */

/* ─── Form wrap ──────────────────────────────────────────────────────────── */
.tspro-form-wrap {
    max-width: 720px;
    font-family: var(--tspro-font);
    font-size: var(--tspro-font-size);
    color: var(--tspro-text);
    line-height: var(--tspro-line-height);
}

/* ─── Form layout ────────────────────────────────────────────────────────── */
.tspro-form { display: flex; flex-direction: column; gap: 18px; }

.tspro-form-row { display: flex; flex-direction: column; gap: 5px; }

.tspro-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tspro-form-row--inline {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.tspro-form-row--submit { flex-direction: row; gap: 10px; align-items: center; flex-wrap: wrap; }
.tspro-form-row--actions { flex-direction: row; gap: 10px; flex-wrap: wrap; }

.tspro-form-row--avatar { flex-direction: row; align-items: center; gap: 16px; }
.tspro-avatar-wrap { display: flex; align-items: center; gap: 14px; }
.tspro-avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--tspro-border); }

/* ─── Labels ─────────────────────────────────────────────────────────────── */
.tspro-form-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tspro-text);
}
.tspro-form-row label .required { color: var(--tspro-danger); margin-left: 2px; }

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.tspro-form input[type="text"],
.tspro-form input[type="email"],
.tspro-form input[type="url"],
.tspro-form input[type="password"],
.tspro-form input[type="number"],
.tspro-form input[type="datetime-local"],
.tspro-form select,
.tspro-form textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    font-family: var(--tspro-font);
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius);
    background: var(--tspro-white);
    color: var(--tspro-text);
    transition: border-color .15s, box-shadow .15s;
    line-height: 1.4;
}
.tspro-form input:focus,
.tspro-form select:focus,
.tspro-form textarea:focus {
    outline: none;
    border-color: var(--tspro-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, .12);
}
.tspro-form textarea { resize: vertical; min-height: 100px; }
.tspro-form select { appearance: auto; }

/* ─── Hints ──────────────────────────────────────────────────────────────── */
.tspro-field-hint {
    font-size: 12px;
    color: var(--tspro-text-muted);
    margin: 2px 0 0;
}

/* ─── Checkboxes / radios ────────────────────────────────────────────────── */
.tspro-checkbox-label,
.tspro-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}
.tspro-checkbox-label input[type="checkbox"],
.tspro-radio-label   input[type="radio"] {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ─── Fieldset ───────────────────────────────────────────────────────────── */
.tspro-form-fieldset {
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius);
    padding: 14px 16px;
    margin: 0;
}
.tspro-form-fieldset legend {
    font-size: 13px;
    font-weight: 600;
    padding: 0 6px;
    color: var(--tspro-text-muted);
}

/* ─── Conditional field (hidden until trigger matches) ───────────────────── */
.tspro-conditional { display: none; }
.tspro-conditional.is-visible { display: flex; }

/* ─── Multi-step form ────────────────────────────────────────────────────── */
.tspro-steps-form .tspro-step-nav {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius);
    overflow: hidden;
}
.tspro-steps-form .tspro-step {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tspro-text-muted);
    background: var(--tspro-bg);
    border-right: 1px solid var(--tspro-border);
    cursor: default;
}
.tspro-steps-form .tspro-step:last-child { border-right: none; }
.tspro-steps-form .tspro-step.is-active {
    background: var(--tspro-primary);
    color: #fff;
}
.tspro-step-panel { display: none; }
.tspro-step-panel.is-active { display: flex; flex-direction: column; gap: 18px; }
.tspro-step-actions { display: flex; gap: 10px; margin-top: 8px; }

.tspro-job-preview {
    background: var(--tspro-bg);
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius);
    padding: 20px;
    min-height: 120px;
    font-size: 14px;
}

/* ─── Tabs (register form) ───────────────────────────────────────────────── */
.tspro-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--tspro-border);
}
.tspro-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tspro-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .12s, border-color .12s;
}
.tspro-tab.is-active {
    color: var(--tspro-primary);
    border-bottom-color: var(--tspro-primary);
}

/* ─── Auth form specifics ────────────────────────────────────────────────── */
.tspro-login-form,
.tspro-register-form {
    max-width: 480px;
    margin: 0 auto;
    padding: 28px;
    background: var(--tspro-white);
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius-lg);
    box-shadow: var(--tspro-shadow-md);
}
.tspro-form-footer {
    text-align: center;
    font-size: 13px;
    color: var(--tspro-text-muted);
    margin-top: 16px;
}
.tspro-forgot-link { font-size: 13px; color: var(--tspro-primary); text-decoration: none; }

/* ─── Pricing table ──────────────────────────────────────────────────────── */
.tspro-pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.tspro-pricing-card {
    background: var(--tspro-white);
    border: 2px solid var(--tspro-border);
    border-radius: var(--tspro-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--tspro-shadow);
    transition: border-color .15s, box-shadow .15s;
}
.tspro-pricing-card:hover { border-color: var(--tspro-primary); box-shadow: var(--tspro-shadow-md); }
.tspro-pricing-card.is-current { border-color: var(--tspro-primary); }
.tspro-pricing-card__name { font-size: 17px; font-weight: 700; margin: 0; }
.tspro-pricing-card__price { display: flex; align-items: baseline; gap: 4px; }
.tspro-price-amount { font-size: 32px; font-weight: 800; color: var(--tspro-primary); }
.tspro-price-period { font-size: 13px; color: var(--tspro-text-muted); }
.tspro-pricing-card__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}
.tspro-pricing-card__features li::before { content: "✓ "; color: var(--tspro-success); font-weight: 700; }
.tspro-pricing-card__action { margin-top: auto; }

/* ─── Resume builder ─────────────────────────────────────────────────────── */
.tspro-resume-section {
    background: var(--tspro-white);
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius);
    padding: 20px;
    margin-bottom: 20px;
}
.tspro-resume-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.tspro-resume-section__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--tspro-text);
}
.tspro-resume-items { display: flex; flex-direction: column; gap: 10px; }
.tspro-resume-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--tspro-bg);
    border-radius: var(--tspro-radius);
    gap: 12px;
    flex-wrap: wrap;
}
.tspro-resume-item__summary { font-size: 13px; flex: 1; }
.tspro-resume-item__dates { display: block; font-size: 12px; color: var(--tspro-text-muted); margin-top: 2px; }
.tspro-resume-item__actions { display: flex; gap: 6px; flex-shrink: 0; }

.tspro-skills-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.tspro-skill-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tspro-primary-light);
    color: var(--tspro-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.tspro-skill-level { font-size: 11px; opacity: .75; }
.tspro-skill-pill button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tspro-primary);
    font-size: 15px;
    padding: 0;
    line-height: 1;
    opacity: .6;
}
.tspro-skill-pill button:hover { opacity: 1; }

/* ─── Checkout ───────────────────────────────────────────────────────────── */
.tspro-checkout { max-width: 520px; }
.tspro-checkout-summary {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
}
.tspro-checkout-summary th,
.tspro-checkout-summary td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--tspro-border);
    text-align: left;
}
.tspro-checkout-summary th { width: 40%; color: var(--tspro-text-muted); font-weight: 500; }
.tspro-checkout-back { margin-top: 14px; font-size: 13px; }
.tspro-checkout-back a { color: var(--tspro-primary); text-decoration: none; }



/* ─── Job alerts form ────────────────────────────────────────────────────── */
.tspro-alerts-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.tspro-alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--tspro-white);
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius);
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--tspro-shadow);
}
.tspro-alert-item__info { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.tspro-alert-item__meta { font-size: 12px; color: var(--tspro-text-muted); }
.tspro-alert-item__frequency { font-size: 11px; color: var(--tspro-primary); font-weight: 600; margin-top: 2px; }
.tspro-alert-item__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── Logo preview ───────────────────────────────────────────────────────── */
.tspro-logo-preview img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--tspro-border);
    border-radius: var(--tspro-radius);
    background: var(--tspro-bg);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .tspro-form-grid { grid-template-columns: 1fr; }
    .tspro-pricing-table { grid-template-columns: 1fr; }
    .tspro-login-form, .tspro-register-form { padding: 18px; }
}



/* ==========================================================================
   Tsjob PRO — Modal overlay (resume builder add/edit items, etc.)
   Append to ts-pro-forms.css, or replace existing .tspro-modal* rules
   with this block if they already exist but aren't taking effect.
   ========================================================================== */

.tspro-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000; /* above admin bar (999xx) and most theme headers */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tspro-modal-overlay.is-open {
    display: flex;
}

.tspro-modal {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.tspro-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
}

.tspro-modal-close:hover {
    color: #111;
}

/* Prevent background scroll while modal is open */
body.tspro-modal-open {
    overflow: hidden;
}

/* Modal form field spacing (buildItemForm() generated markup) */
.tspro-modal .tspro-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tspro-modal .tspro-field label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.tspro-modal .tspro-field input,
.tspro-modal .tspro-field select,
.tspro-modal .tspro-field textarea {
    padding: 8px 10px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.tspro-modal .tspro-field--check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.tspro-modal .tspro-field--check label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
}