/* Recruitment Flow - Public Registration Form Styles */
/* Mobile-first responsive design inspired by Vejthani Hospital website */

/* Reset and Base Styles */
.rf-form * {
    box-sizing: border-box;
}

.rf-form {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 16px;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
}

/* Heading Styles */
.rf-form h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 24px 0;
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e5e5;
}

.rf-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 32px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}

.rf-form .icon {
    display: none; /* Remove decorative icons */
}

.rf-form .section-divider {
    display: none; /* Remove decorative dividers */
}

/* Section Styles */
.rf-form .rf-section {
    background: #ffffff;
    margin-bottom: 24px;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* PDPA Consent Section */
.rf-form .rf-consent-section {
    background: #fffef5;
    border: 1px solid #ffd700;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 24px;
}

.rf-form .rf-consent-box {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.rf-form .rf-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.rf-form .rf-consent-checkbox {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    margin: 4px 0 0 0 !important;
    flex-shrink: 0;
    cursor: pointer;
}

.rf-form .rf-consent-text {
    flex: 1;
    color: #333333;
}

.rf-form .rf-consent-error {
    background: #fff0f0;
    border: 1px solid #ff4444;
    color: #cc0000;
    padding: 12px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 14px;
}

.rf-form .rf-consent-info {
    display: inline-block;
    margin-left: 4px;
    cursor: help;
    color: #0066cc;
    font-size: 14px;
}

/* Form Table */
.rf-form .form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.rf-form .form-table tr {
    display: block;
    margin-bottom: 16px;
}

.rf-form .form-table th {
    display: block;
    width: 100%;
    padding: 0 0 6px 0;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

.rf-form .form-table td {
    display: block;
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* English Caption */
.rf-form .en-caption {
    display: block;
    font-size: 13px;
    color: #666666;
    font-weight: 400;
    margin-top: 2px;
}

/* Input Fields */
.rf-form input[type="text"],
.rf-form input[type="tel"],
.rf-form input[type="email"],
.rf-form select,
.rf-form textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    font-size: 16px;
    line-height: 1.5;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.rf-form input[type="text"]:focus,
.rf-form input[type="tel"]:focus,
.rf-form input[type="email"]:focus,
.rf-form select:focus,
.rf-form textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.rf-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* Select2 styling overrides for better integration */
.rf-form .select2-container {
    font-size: 16px;
}

.rf-form .select2-container--default .select2-selection--single {
    height: auto !important;
    padding: 12px !important;
    border: 1px solid #cccccc !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    outline: none !important;
}

.rf-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0 !important;
    padding-right: 30px !important;
    color: #333333 !important;
}

.rf-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 12px !important;
}

.rf-form .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}

.rf-form .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}

/* Hide clear button */
.rf-form .select2-container--default .select2-selection--single .select2-selection__clear {
    display: none !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0066cc;
}

.select2-dropdown {
    border-color: #cccccc;
    border-radius: 4px;
}

.select2-search--dropdown .select2-search__field {
    padding: 8px 12px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 16px;
}

.select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: #0066cc;
}

.rf-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.rf-form input[type="file"] {
    font-size: 14px;
    padding: 8px 0;
}

.rf-form .description {
    font-size: 13px;
    color: #666666;
    margin: 6px 0 0 0;
}

/* Error State */
.rf-form .rf-date-error {
    border-color: #ff4444 !important;
    background-color: #fff5f5 !important;
}

/* Experience Table */
.rf-form .exp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    overflow-x: auto;
    display: block;
}

.rf-form .exp-table thead {
    display: none; /* Hide headers on mobile */
}

.rf-form .exp-table tbody {
    display: block;
}

.rf-form .exp-table tr {
    display: block;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fafafa;
}

.rf-form .exp-table td {
    display: block;
    width: 100%;
    padding: 0 0 12px 0;
    border: none;
    background: transparent;
}

.rf-form .exp-table td:last-child {
    padding-bottom: 0;
}

.rf-form .exp-table input {
    width: 100%;
}

.rf-form .exp-table .remove-exp-row {
    width: 100%;
    background: #ff4444;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.rf-form .exp-table .remove-exp-row:hover {
    background: #cc0000;
}

/* Buttons */
.rf-form button[type="button"],
.rf-form button[type="submit"] {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.rf-form button[type="button"] {
    background: #f0f0f0;
    color: #333333;
    margin-bottom: 12px;
}

.rf-form button[type="button"]:hover {
    background: #e0e0e0;
}

.rf-form button[type="submit"] {
    background: #0066cc;
    color: #ffffff;
}

.rf-form button[type="submit"]:hover {
    background: #0052a3;
}

.rf-form button[type="button"]:active,
.rf-form button[type="submit"]:active {
    transform: translateY(1px);
}

.rf-form p {
    text-align: center;
    margin: 24px 0;
}

/* Success/Error Messages */
.rf-success {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 24px;
}

.rf-error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 24px;
}

/* Tablet and Desktop Styles */
@media (min-width: 768px) {
    .rf-form {
        padding: 32px 24px;
        max-width: 960px;
        margin: 24px auto;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
    }

    .rf-form h2 {
        font-size: 28px;
        margin-bottom: 32px;
    }

    .rf-form h3 {
        font-size: 20px;
        margin: 40px 0 20px 0;
    }

    .rf-form .form-table tr {
        display: table-row;
        margin-bottom: 0;
    }

    .rf-form .form-table th {
        display: table-cell;
        width: 35%;
        padding: 12px 24px 12px 0;
        vertical-align: top;
    }

    .rf-form .form-table td {
        display: table-cell;
        padding: 12px 0;
    }

    /* Experience Table - Show as proper table on larger screens */
    .rf-form .exp-table {
        display: table;
    }

    .rf-form .exp-table thead {
        display: table-header-group;
    }

    .rf-form .exp-table tbody {
        display: table-row-group;
    }

    .rf-form .exp-table tr {
        display: table-row;
        margin-bottom: 0;
        padding: 0;
        border: none;
        background: transparent;
    }

    .rf-form .exp-table th {
        display: table-cell;
        padding: 12px 8px;
        font-weight: 600;
        background: #f5f5f5;
        border-bottom: 2px solid #e5e5e5;
    }

    .rf-form .exp-table td {
        display: table-cell;
        padding: 12px 8px;
        border-bottom: 1px solid #e5e5e5;
        background: #ffffff;
    }

    .rf-form .exp-table input {
        width: 100%;
        min-width: 120px;
    }

    .rf-form .exp-table .remove-exp-row {
        width: auto;
        padding: 8px 16px;
    }

    .rf-form button[type="button"],
    .rf-form button[type="submit"] {
        width: auto;
        min-width: 160px;
        margin-right: 12px;
    }

    .rf-form p {
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .rf-form {
        max-width: 1100px;
        padding: 40px 48px;
    }

    .rf-form .form-table th {
        width: 30%;
    }
}
