/* RSA Recruitment Bridge Styling - Modernized */
:root {
    --rsa-primary: #0D4A4F; /* BRAND.teal */
    --rsa-primary-dark: #0A3C40; /* Derived from teal.800 */
    --rsa-primary-light: #CCFBF1; /* Derived from teal.100 */
    --rsa-secondary: #D4A017; /* BRAND.gold */
    --rsa-text-main: #111827; /* Gray 900 */
    --rsa-text-muted: #6b7280; /* Gray 500 */
    --rsa-bg-light: #F8FAFC; /* BRAND surface */
    --rsa-border: #e5e7eb; /* Gray 200 */
    --rsa-card-glow: 0 10px 40px -10px rgba(13, 74, 79, 0.15); /* Updated rgba for teal */
    --rsa-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --rsa-radius: 16px;
}

.rsa-jobs-container, .rsa-job-details-container {
    margin: 60px auto;
    max-width: 1200px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--rsa-text-main);
    line-height: 1.6;
}

/* Typography & Base */
.rsa-jobs-container *, .rsa-job-details-container * {
    box-sizing: border-box;
}

/* Listings Header */
.rsa-jobs-header {
    text-align: center;
    margin-bottom: 50px;
}

.rsa-jobs-header h2 {
    font-size: 2.5rem;
    color: var(--rsa-primary);
    font-weight: 800;
    margin-bottom: 15px;
}

.rsa-jobs-header p {
    font-size: 1.1rem;
    color: var(--rsa-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Job Listing Grid */
.rsa-jobs-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.rsa-job-card-link {
    text-decoration: none !important;
    display: block;
    color: inherit;
}

.rsa-job-card {
    background: #ffffff;
    border: 1px solid var(--rsa-border);
    border-radius: var(--rsa-radius);
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--rsa-card-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rsa-job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rsa-card-glow);
    border-color: var(--rsa-primary-light);
}

.rsa-job-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--rsa-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.rsa-job-card:hover::before {
    opacity: 1;
}

.rsa-job-info {
    flex: 1;
}

.rsa-job-title {
    margin: 0 0 12px 0;
    color: var(--rsa-text-main);
    font-size: 1.4rem;
    font-weight: 700;
}

.rsa-job-card:hover .rsa-job-title {
    color: var(--rsa-primary);
}

.rsa-job-meta, .rsa-job-meta-full {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}

.rsa-job-tag {
    background: var(--rsa-bg-light);
    color: var(--rsa-text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    border: 1px solid var(--rsa-border);
}

.rsa-job-tag i {
    margin-right: 6px;
    font-size: 0.9em;
}

.rsa-tag-category { background: #e8f4fd; color: #026bbd; border-color: #d0e7fa; }
.rsa-tag-location { background: #fdf2e8; color: #c45e03; border-color: #fae4cf; }
.rsa-tag-type { background: #ebf9eb; color: #167a16; border-color: #d3f3d3; }
.rsa-tag-mode { background: #f4e8fd; color: #6a1b9a; border-color: #e6cfff; }

.rsa-btn-view {
    color: var(--rsa-primary);
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.rsa-job-card:hover .rsa-btn-view {
    color: var(--rsa-primary-dark);
    gap: 12px;
}

/* Empty State */
.rsa-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: var(--rsa-radius);
    border: 1px dashed var(--rsa-border);
}

.rsa-empty-state i {
    font-size: 3rem;
    color: var(--rsa-text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Job Details Layout */
.rsa-back-link {
    text-decoration: none;
    color: var(--rsa-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    margin-bottom: 30px;
    transition: color 0.2s;
}

.rsa-back-link:hover {
    color: var(--rsa-primary);
}

.rsa-back-link i {
    margin-right: 8px;
}

.rsa-job-details-header {
    margin-bottom: 40px;
}

.rsa-job-details-header .rsa-job-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--rsa-primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.rsa-job-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.rsa-job-description-card {
    background: #ffffff;
    border-radius: var(--rsa-radius);
    padding: 50px;
    box-shadow: var(--rsa-card-shadow);
    border: 1px solid var(--rsa-border);
}

.rsa-section {
    margin-bottom: 45px;
}

.rsa-section:last-child {
    margin-bottom: 0;
}

.rsa-section h3 {
    font-size: 1.4rem;
    color: var(--rsa-text-main);
    margin-bottom: 20px;
    font-weight: 700;
    border-bottom: 2px solid var(--rsa-bg-light);
    padding-bottom: 10px;
}

.rsa-text {
    color: #4b5563;
    font-size: 1.05rem;
    line-height: 1.8;
}

.rsa-text ul {
    margin-top: 15px;
    padding-left: 20px;
}

.rsa-text li {
    margin-bottom: 10px;
}

/* Application Sidebar */
.rsa-job-sidebar {
    position: sticky;
    top: 30px;
}

.rsa-apply-card {
    background: #ffffff;
    border-radius: var(--rsa-radius);
    padding: 40px;
    box-shadow: var(--rsa-card-shadow);
    border: 1px solid var(--rsa-border);
    position: relative;
    overflow: hidden;
}

.rsa-apply-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--rsa-primary);
}

.rsa-apply-card h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: var(--rsa-text-main);
    font-weight: 700;
}

.rsa-apply-subtitle {
    font-size: 0.95rem;
    color: var(--rsa-text-muted);
    margin-bottom: 30px;
}

/* Form Styling */
.rsa-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.rsa-form-group {
    margin-bottom: 5px;
}

.rsa-form-group.full-width {
    grid-column: span 2;
}

.rsa-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--rsa-text-main);
    font-size: 0.9rem;
}

.rsa-required {
    color: #ef4444;
}

/* The CRITICAL Text Color Fix */
#rsa-application-form .rsa-form-group input:not([type="checkbox"]),
#rsa-application-form .rsa-form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px;
    background-color: #f9fafb !important;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    /* !important ensures theme doesn't override it */
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

#rsa-application-form .rsa-form-group input:not([type="checkbox"])::placeholder,
#rsa-application-form .rsa-form-group textarea::placeholder {
    color: #9ca3af !important;
    -webkit-text-fill-color: #9ca3af !important;
}

#rsa-application-form .rsa-form-group input:focus,
#rsa-application-form .rsa-form-group textarea:focus {
    outline: none !important;
    border-color: var(--rsa-primary) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(0, 102, 102, 0.1) !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
}

/* Custom File Upload */
.rsa-file-upload .rsa-upload-wrapper {
    position: relative;
}

.rsa-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.rsa-upload-ui {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: var(--rsa-bg-light);
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: var(--rsa-text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.rsa-file-upload input[type="file"]:hover + .rsa-upload-ui {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* Checkbox */
.rsa-checkbox-group {
    background: var(--rsa-bg-light);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.rsa-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.rsa-checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--rsa-primary);
    flex-shrink: 0;
}

.rsa-checkbox-text {
    font-size: 0.85rem;
    color: var(--rsa-text-muted);
    line-height: 1.5;
}

/* Actions */
.rsa-form-actions {
    margin-top: 30px;
}

.rsa-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--rsa-primary);
    color: #ffffff !important;
    padding: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    transition: all 0.3s;
}

.rsa-btn-submit:hover {
    background: var(--rsa-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 102, 0.2);
}

/* Messages */
.rsa-message {
    margin-top: 25px;
    padding: 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
}

.rsa-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.rsa-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Pagination */
.rsa-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.rsa-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.rsa-pagination li {
    margin: 0;
}

.rsa-pagination a, .rsa-pagination span.current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
}

.rsa-pagination a {
    background: #ffffff;
    color: var(--rsa-text-main);
    border: 1px solid var(--rsa-border);
}

.rsa-pagination a:hover {
    background: var(--rsa-bg-light);
    color: var(--rsa-primary);
    border-color: #cbd5e1;
}

.rsa-pagination span.current {
    background: var(--rsa-primary);
    color: #ffffff;
    border: 1px solid var(--rsa-primary);
    box-shadow: 0 4px 10px rgba(0, 102, 102, 0.2);
}

.rsa-pagination .prev, .rsa-pagination .next {
    gap: 6px;
}

/* Responsive */
@media (max-width: 991px) {
    .rsa-job-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .rsa-job-sidebar {
        position: static;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .rsa-form-grid {
        grid-template-columns: 1fr;
    }

    .rsa-form-group.full-width {
        grid-column: span 1;
    }

    .rsa-job-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px;
    }

    .rsa-job-actions {
        margin-top: 20px;
        width: 100%;
        border-top: 1px solid var(--rsa-border);
        padding-top: 15px;
    }

    .rsa-job-details-header .rsa-job-title {
        font-size: 2rem;
    }

    .rsa-job-description-card, .rsa-apply-card {
        padding: 25px;
    }
}

