/* ============================================================================
   Applicant Portal — Styles
   Extends the main TeamLink styles.css with applicant-specific components
   ============================================================================ */

/* ── Progress Bar ───────────────────────────────────────────────────────── */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 24px 0;
    padding: 0;
    list-style: none;
}

.wizard-progress li {
    flex: 1;
    text-align: center;
    position: relative;
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.wizard-progress li::before {
    content: attr(data-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #999;
    font-weight: 700;
    margin: 0 auto 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wizard-progress li::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: #e9ecef;
    z-index: -1;
}

.wizard-progress li:last-child::after {
    display: none;
}

.wizard-progress li.completed::before {
    background: #2a9d8f;
    color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
}

.wizard-progress li.completed::after {
    background: #2a9d8f;
}

.wizard-progress li.completed {
    color: #2a9d8f;
}

.wizard-progress li.active::before {
    background: #1d3557;
    color: #fff;
}

.wizard-progress li.active {
    color: #1d3557;
    font-weight: 700;
}

/* ── Wizard Pages ───────────────────────────────────────────────────────── */
.wizard-page {
    display: none;
}

.wizard-page.active {
    display: block;
}

/* ── Form Layout ────────────────────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .form-row, .form-row-3, .form-row-4 {
        grid-template-columns: 1fr;
    }
    .wizard-progress li {
        font-size: 0;
    }
    .wizard-progress li::before {
        width: 26px;
        height: 26px;
        font-size: 12px;
        margin-bottom: 0;
    }
    .wizard-progress li::after {
        top: 13px;
        left: calc(50% + 16px);
        width: calc(100% - 32px);
    }
}

.section-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 20px 0;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d3557;
    margin: 20px 0 8px;
}

.field-hint {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ── Yes/No Toggle ──────────────────────────────────────────────────────── */
.yn-group {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.yn-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.yn-group input[type="radio"] {
    display: none;
}

.yn-group input[type="radio"]:checked + span {
    font-weight: 600;
}

.yn-group label:has(input:checked) {
    border-color: #1d3557;
    background: #f0f4f8;
    color: #1d3557;
}

/* ── Wizard Buttons ─────────────────────────────────────────────────────── */
.wizard-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
}

.wizard-buttons .btn {
    min-width: 120px;
}

.btn-primary {
    background: #1d3557;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: #1d3557;
    border: 1px solid #1d3557;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary:hover {
    background: #f0f4f8;
}

.btn-submit {
    background: #2a9d8f;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-submit:hover {
    opacity: 0.85;
}

/* ── Login Page ─────────────────────────────────────────────────────────── */
.login-container {
    max-width: 440px;
    margin: 60px auto;
    padding: 0 16px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.login-card h2 {
    color: #1d3557;
    margin: 0 0 6px;
    font-size: 22px;
}

.login-card .subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 28px;
}

.login-card .input-group {
    text-align: left;
    margin-bottom: 16px;
}

.login-card .input-group label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    display: block;
}

.login-card .input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
}

.login-card .input-group input:focus {
    outline: none;
    border-color: #457b9d;
}

.code-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.code-input-group input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

@media (max-width: 400px) {
    .code-input-group {
        gap: 6px;
    }
    .code-input-group input {
        width: 40px;
        height: 48px;
        font-size: 20px;
        border-radius: 6px;
    }
    .login-card {
        padding: 28px 16px;
    }
}

.code-input-group input:focus {
    outline: none;
    border-color: #1d3557;
}

.resend-link {
    color: #457b9d;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 12px;
    display: inline-block;
}

.resend-link:hover {
    color: #1d3557;
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

/* ── File Upload ────────────────────────────────────────────────────────── */
.uploaded-files-list {
    margin-bottom: 6px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f0faf8;
    border: 1px solid #2a9d8f;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #1d3557;
}

.uploaded-file-item i {
    color: #2a9d8f;
    flex-shrink: 0;
}

.file-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px dashed #457b9d;
    border-radius: 6px;
    font-size: 13px;
    color: #457b9d;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.file-add-btn:hover {
    background: #f0f4f8;
    border-color: #1d3557;
    color: #1d3557;
}

.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 6px;
}

.file-upload-area:hover {
    border-color: #457b9d;
    background: #f8f9fd;
}

.file-upload-area.has-file {
    border-color: #2a9d8f;
    background: #f0faf8;
}

.file-upload-area i {
    font-size: 24px;
    color: #999;
    display: block;
    margin-bottom: 6px;
}

.file-upload-area.has-file i {
    color: #2a9d8f;
}

.file-upload-area .file-name {
    font-size: 13px;
    color: #2a9d8f;
    font-weight: 600;
}

.file-upload-area .file-hint {
    font-size: 12px;
    color: #999;
}

/* ── Status Timeline ────────────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding: 0 0 24px 50px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: 6px;
    top: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 1;
    border: 2px solid #fff;
}

.timeline-icon.completed {
    background: #2a9d8f;
    color: #fff;
}

.timeline-icon.current {
    background: #1d3557;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(29,53,87,0.15);
}

.timeline-icon.upcoming {
    background: #e9ecef;
    color: #999;
}

.timeline-icon.failed {
    background: #e63946;
    color: #fff;
}

.timeline-icon.waiting {
    background: #f0ad4e;
    color: #fff;
}

.timeline-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
}

.timeline-content.current {
    border-color: #1d3557;
    box-shadow: 0 1px 4px rgba(29,53,87,0.1);
}

.timeline-content h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: #1d3557;
}

.timeline-content .stage-status {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.timeline-content .stage-status.completed { color: #2a9d8f; }
.timeline-content .stage-status.in_progress { color: #1d3557; }
.timeline-content .stage-status.failed { color: #e63946; }
.timeline-content .stage-status.waiting { color: #f0ad4e; }
.timeline-content .stage-status.not_started { color: #999; }

.timeline-content p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #666;
}

.timeline-content .next-action {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fd;
    border-radius: 6px;
    font-size: 12px;
    color: #1d3557;
    font-weight: 500;
}

/* ── Info Banner ────────────────────────────────────────────────────────── */
.info-banner {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.info-banner i {
    font-size: 20px;
    color: #856404;
}

.info-banner p {
    margin: 0;
    font-size: 14px;
    color: #856404;
    font-weight: 500;
}

/* ── Reference Card ─────────────────────────────────────────────────────── */
.reference-card {
    background: #f8f9fd;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.reference-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #1d3557;
}

/* ── Textarea ───────────────────────────────────────────────────────────── */
.apply-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.apply-textarea:focus {
    outline: none;
    border-color: #457b9d;
}

.apply-textarea.essay {
    min-height: 180px;
}

/* ── Conditional Fields ─────────────────────────────────────────────────── */
.conditional-field {
    display: none;
    margin-top: 8px;
    padding-left: 16px;
    border-left: 3px solid #e9ecef;
}

.conditional-field.visible {
    display: block;
}

/* ── Applicant Header ───────────────────────────────────────────────────── */
.apply-header {
    text-align: center;
    padding: 24px 16px;
}

.apply-header img {
    height: 48px;
    margin-bottom: 8px;
}

.apply-header h1 {
    color: #1d3557;
    font-size: 20px;
    margin: 0 0 4px;
}

.apply-header .org-name {
    color: #457b9d;
    font-size: 14px;
    font-weight: 500;
}

/* ── Required asterisk ──────────────────────────────────────────────────── */
.required::after {
    content: ' *';
    color: #e63946;
}
