/* ── Step 2 — 6-Tab Candidature Form ── */

.cand-step2-wrap {

    max-width: 720px;
    margin: 0 auto 4em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Progress bar ── */
.cand-progress {
    background: #eee;
    border-radius: 20px;
    height: 8px;
    margin-bottom: 0.5em;
    overflow: hidden;
}
.cand-progress-bar {
    height: 100%;
    background: #1e1e1e;
    border-radius: 20px;
    transition: width 0.3s ease;
}
.cand-progress-text {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 1.5em;
    text-align: center;
}

/* ── Tab bar ── */
.cand-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 2em;
    border-bottom: 2px solid #eee;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cand-tab {
    flex: 1;
    padding: 0.7em 0.5em;
    text-align: center;
    font-size: 0.82em;
    font-weight: 600;
    color: #999;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
    min-width: 0;
}
.cand-tab:hover {
    color: #555;
}
.cand-tab.active {
    color: #1e1e1e;
    border-bottom-color: #1e1e1e;
}
.cand-tab.completed {
    color: #2d7d2d;
}
.cand-tab.completed::after {
    content: " \2713";
}

/* ── Tab panels ── */
.cand-panel {
    display: none;
}
.cand-panel.active {
    display: block;
}

/* ── Form fields ── */
.cand-field {
    margin-bottom: 1.4em;
}
.cand-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3em;
    font-size: 0.95em;
}
.cand-field input[type="text"],
.cand-field input[type="email"],
.cand-field input[type="tel"],
.cand-field input[type="number"],
.cand-field input[type="url"],
.cand-field input[type="time"],
.cand-field select,
.cand-field textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.cand-field input:focus,
.cand-field select:focus,
.cand-field textarea:focus {
    outline: none;
    border-color: #1e1e1e;
}
.cand-field textarea {
    resize: vertical;
    min-height: 80px;
}
.cand-hint {
    font-size: 0.85em;
    color: #888;
    margin-top: 0.2em;
}
.cand-required::after {
    content: " *";
    color: #c00;
}

/* Invalid field */
.cand-invalid {
    border-color: #c00 !important;
}
.cand-field-error {
    color: #c00;
    font-size: 0.85em;
    margin-top: 0.2em;
}

/* Read-only info from step 1 */
.cand-readonly {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    margin-bottom: 1.5em;
    padding: 1em;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}
.cand-readonly-item {
    flex: 1;
    min-width: 140px;
}
.cand-readonly-label {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cand-readonly-value {
    font-weight: 600;
    font-size: 0.95em;
}

/* ── Inline fields (side by side) ── */
.cand-inline {
    display: flex;
    gap: 1em;
}
.cand-inline .cand-field {
    flex: 1;
    min-width: 0;
}

/* ── Subdomain field ── */
.cand-subdomain-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}
.cand-subdomain-wrap input {
    border-radius: 6px 0 0 6px !important;
    flex: 1;
}
.cand-subdomain-suffix {
    padding: 0.6em 0.8em;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 6px 6px 0;
    font-size: 0.95em;
    color: #555;
    white-space: nowrap;
}
.cand-subdomain-status {
    margin-top: 0.3em;
    font-size: 0.85em;
    min-height: 1.2em;
}
.cand-subdomain-status.checking { color: #888; }
.cand-subdomain-status.available { color: #2d7d2d; }
.cand-subdomain-status.taken { color: #c00; }

/* ── Photo upload ── */
.cand-photo-field {
    margin-bottom: 1.4em;
}
.cand-photo-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3em;
    font-size: 0.95em;
}
.cand-dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 1.5em;
    text-align: center;
    cursor: pointer;
    color: #888;
    transition: border-color 0.2s, background 0.2s;
    font-size: 0.9em;
}
.cand-dropzone:hover,
.cand-dropzone.dragover {
    border-color: #1e1e1e;
    background: #fafafa;
}
.cand-dropzone input[type="file"] {
    display: none;
}
.cand-dropzone-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 0.3em;
}
.cand-photo-previews {
    display: flex;
    gap: 0.8em;
    flex-wrap: wrap;
    margin-top: 0.8em;
}
.cand-photo-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}
.cand-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    height: auto;
}
.cand-photo-thumb.loading {
    background: #f0f0f0;
}
.cand-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}
.cand-photo-remove:hover {
    background: rgba(200,0,0,0.8);
}
.cand-error-icon {
    color: #c00;
    font-size: 1.5em;
    font-weight: bold;
}

/* ── Spinner ── */
.cand-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #ddd;
    border-top-color: #1e1e1e;
    border-radius: 50%;
    animation: cand-spin 0.8s linear infinite;
}
@keyframes cand-spin {
    to { transform: rotate(360deg); }
}

/* ── Facebook button (disabled) ── */
.cand-fb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.6em 1.2em;
    background: #e0e0e0;
    color: #999;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: not-allowed;
    margin-top: 0.5em;
}
.cand-fb-btn .cand-fb-icon {
    font-size: 1.2em;
}

/* ── Radio / Checkbox groups ── */
.cand-radio-group,
.cand-checkbox-group {
    margin-top: 0.5em;
}
.cand-radio-item,
.cand-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
    padding: 0.8em 1em;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 0.5em;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.cand-radio-item:hover,
.cand-checkbox-item:hover {
    border-color: #999;
}
.cand-radio-item input[type="radio"],
.cand-checkbox-item input[type="checkbox"] {
    margin-top: 0.15em;
    flex-shrink: 0;
}
.cand-radio-item .cand-radio-label,
.cand-checkbox-item .cand-checkbox-label {
    font-weight: 600;
    font-size: 0.95em;
}
.cand-radio-item .cand-radio-desc,
.cand-checkbox-item .cand-checkbox-desc {
    font-size: 0.85em;
    color: #666;
    margin-top: 0.1em;
}

/* ── Cours particuliers conditional ── */
.cand-conditional {
    display: none;
    padding: 1em;
    background: #f8f8f8;
    border-radius: 6px;
    margin-top: 0.5em;
}
.cand-conditional.visible {
    display: block;
}

/* ── Section title ── */
.cand-section-title {
    font-size: 1.1em;
    font-weight: 700;
    margin: 1.5em 0 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eee;
}

/* ── Navigation bar ── */
.cand-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
    padding-bottom: 4em;
}
.cand-btn {
    padding: 0.7em 2em;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.cand-btn-prev {
    background: #f0f0f0;
    color: #333;
}
.cand-btn-prev:hover {
    background: #e0e0e0;
}
.cand-btn-next {
    background: #1e1e1e;
    color: #fff;
    margin-left: auto;
}
.cand-btn-next:hover {
    background: #333;
}
.cand-btn-submit {
    background: #2d7d2d;
    color: #fff;
    margin-left: auto;
    font-size: 1em;
    padding: 0.8em 2.5em;
}
.cand-btn-submit:hover {
    background: #246924;
}
.cand-btn-submit:disabled {
    background: #999;
    cursor: wait;
}

/* ── Loading overlay ── */
.cand-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1em;
}
.cand-loading-overlay .cand-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
}
.cand-loading-text {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

/* ── CGU section ── */
.cand-cgu {
    padding: 1em;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    margin: 1em 0;
}
.cand-cgu label {
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    cursor: pointer;
    font-weight: normal !important;
}
.cand-cgu input[type="checkbox"] {
    margin-top: 0.2em;
    flex-shrink: 0;
}

/* ── Error / Success ── */
.cand-error-box {
    background: #fce4e4;
    border: 1px solid #e0b4b4;
    padding: 1em;
    border-radius: 6px;
    margin-bottom: 1.5em;
    color: #8b0000;
}
.cand-success-box {
    background: #e4f5e4;
    border: 1px solid #b4d4b4;
    padding: 1.5em;
    border-radius: 8px;
}
.cand-success-box h3 {
    margin-top: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .cand-step2-wrap {
        padding: 0 0.5em;
    }
    .cand-tabs {
        gap: 0;
    }
    .cand-tab {
        font-size: 0.72em;
        padding: 0.6em 0.3em;
    }
    .cand-inline {
        flex-direction: column;
        gap: 0;
    }
    .cand-readonly {
        flex-direction: column;
        gap: 0.5em;
    }
    .cand-nav {
        gap: 0.5em;
    }
    .cand-btn {
        padding: 0.7em 1.2em;
        font-size: 0.9em;
    }
    .cand-photo-thumb {
        width: 70px;
        height: 70px;
    }
}

/* ── Address autocomplete ── */
.cand-address-wrap {
    position: relative;
}
.cand-address-wrap input[type="text"] {
    width: 100%;
}
.cand-address-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
}
.cand-address-item {
    display: block;
    width: 100%;
    padding: 0.6em 0.8em;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    text-align: left;
    font-size: 0.9em;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}
.cand-address-item:last-child {
    border-bottom: none;
}
.cand-address-item:hover,
.cand-address-item:focus {
    background: #f5f5f5;
    outline: none;
}
.cand-address-empty {
    padding: 0.8em;
    text-align: center;
    color: #888;
    font-size: 0.9em;
}

/* ── Course blocks ── */
.cand-course-block {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.2em;
    margin-bottom: 1em;
    background: #fafafa;
}
.cand-course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8em;
}
.cand-course-header strong {
    font-size: 1em;
}
.cand-course-remove {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.3em 0.8em;
    font-size: 0.85em;
    color: #888;
    cursor: pointer;
    font-family: inherit;
}
.cand-course-remove:hover {
    color: #c00;
    border-color: #c00;
}
.cand-btn-add {
    display: inline-block;
    background: none;
    border: 1px dashed #aaa;
    border-radius: 6px;
    padding: 0.6em 1.2em;
    font-size: 0.9em;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 1em;
}
.cand-btn-add:hover {
    border-color: #1e1e1e;
    color: #1e1e1e;
}

/* ── Photo preview (replaces dropzone after upload) ── */
.cand-dropzone.uploading {
    opacity: 0.6;
    pointer-events: none;
}
.cand-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: cand-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4em;
}
@keyframes cand-spin {
    to { transform: rotate(360deg); }
}

.cand-photo-preview {
    position: relative;
    display: inline-block;
}
.cand-photo-preview img {
    display: block;
    max-width: 250px;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
}
.cand-photo-actions {    position: absolute;    top: 8px;    right: 8px;}
.cand-photo-delete {    background: none;    border: none;    color: #cc0000;    font-size: 32px;    cursor: pointer;    padding: 0;    line-height: 1;    font-weight: bold;}
.cand-photo-delete:hover {
    color: #900;
}

/* ── AI beta modal ── */
.cand-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, 0.75);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cand-modal-overlay.cand-modal-visible {
    display: flex;
}
.cand-modal-box {
    background: #fff;
    color: #1a1a1a;
    max-width: 560px;
    width: 100%;
    padding: 2em 2em 1.5em;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    line-height: 1.55;
}
.cand-modal-box h3 {
    margin: 0 0 0.8em;
    font-size: 1.3em;
    color: #1a1a1a;
}
.cand-modal-box p {
    margin: 0 0 1em;
    font-size: 0.95em;
}
.cand-modal-box p strong {
    color: #b8590b;
}
.cand-modal-box a {
    color: #1e6ed8;
    text-decoration: underline;
}
.cand-modal-box .cand-btn-submit {
    display: block;
    margin: 1.5em auto 0;
    min-width: 180px;
}
