/**
 * BHUTH Integration - Forms Stylesheet
 * Location: wp-content/plugins/bhuth-integration/assets/css/bhuth-forms.css
 */

/* ============================================================
   FORM SECTIONS
   ============================================================ */
.bhuth-form-section {
    background: #fff;
    border: 1px solid var(--bhuth-int-gray-200);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bhuth-form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--bhuth-int-font-head);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bhuth-int-primary-600);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bhuth-int-primary-100);
}

.bhuth-form-section-title svg {
    flex-shrink: 0;
    color: var(--bhuth-int-primary-500);
}

/* ============================================================
   FORM ROWS AND FIELDS
   ============================================================ */
.bhuth-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bhuth-form-row.cols-2 { grid-template-columns: 1fr; }
.bhuth-form-row.cols-3 { grid-template-columns: 1fr; }
.bhuth-form-row.cols-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
    .bhuth-form-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .bhuth-form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .bhuth-form-row.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .bhuth-form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.bhuth-field {
    display: flex;
    flex-direction: column;
}

.bhuth-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bhuth-int-gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

.bhuth-field label .required {
    color: var(--bhuth-int-red-500);
}

.bhuth-field input[type="text"],
.bhuth-field input[type="email"],
.bhuth-field input[type="tel"],
.bhuth-field input[type="date"],
.bhuth-field input[type="number"],
.bhuth-field select,
.bhuth-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bhuth-int-gray-50);
    border: 1px solid var(--bhuth-int-gray-300);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--bhuth-int-gray-900);
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.4;
}

.bhuth-field input:focus,
.bhuth-field select:focus,
.bhuth-field textarea:focus {
    outline: none;
    border-color: var(--bhuth-int-primary-500);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
    background: #fff;
}

.bhuth-field input:disabled,
.bhuth-field select:disabled {
    background: var(--bhuth-int-gray-100);
    cursor: not-allowed;
    opacity: 0.7;
}

.bhuth-field textarea {
    resize: vertical;
    min-height: 80px;
}

.bhuth-field input.error,
.bhuth-field select.error,
.bhuth-field textarea.error {
    border-color: var(--bhuth-int-red-500);
    background: #fef2f2;
}

.bhuth-field .error-message {
    font-size: 0.75rem;
    color: var(--bhuth-int-red-500);
    margin-top: 0.25rem;
}

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.bhuth-file-upload-container {
    position: relative;
}

.bhuth-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed var(--bhuth-int-primary-200);
    border-radius: 0.75rem;
    background: var(--bhuth-int-gray-50);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.bhuth-file-upload:hover {
    border-color: var(--bhuth-int-primary-400);
    background: var(--bhuth-int-primary-50);
}

.bhuth-file-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bhuth-file-upload-icon {
    width: 40px;
    height: 40px;
    color: var(--bhuth-int-primary-400);
    margin-bottom: 0.5rem;
}

.bhuth-file-upload p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bhuth-int-gray-700);
}

.bhuth-file-upload small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--bhuth-int-gray-400);
}

/* File Preview */
.bhuth-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
}

.bhuth-file-preview-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.bhuth-file-preview-info svg {
    color: #16a34a;
    flex-shrink: 0;
}

.bhuth-file-preview-info .file-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #166534;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bhuth-file-preview-info .file-size {
    font-size: 0.75rem;
    color: #15803d;
    margin-top: 0.1rem;
}

.bhuth-file-remove {
    background: none;
    border: none;
    color: #16a34a;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bhuth-file-remove:hover {
    background: rgba(22, 163, 74, 0.1);
    color: #dc2626;
}

/* ============================================================
   PROGRESS STEPS
   ============================================================ */
.bhuth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0 2.5rem;
    flex-wrap: nowrap;
    gap: 0;
}

.bhuth-step {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.bhuth-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    background: var(--bhuth-int-gray-200);
    color: var(--bhuth-int-gray-500);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.bhuth-step.active .bhuth-step-number {
    background: var(--bhuth-int-primary-600);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
}

.bhuth-step.completed .bhuth-step-number {
    background: var(--bhuth-int-green-500);
    color: #fff;
}

.bhuth-step-line {
    flex: 1;
    min-width: 30px;
    max-width: 100px;
    height: 2px;
    background: var(--bhuth-int-gray-200);
    transition: background 0.3s ease;
}

.bhuth-step.completed + .bhuth-step-line,
.bhuth-step.completed ~ .bhuth-step-line {
    background: var(--bhuth-int-green-500);
}

/* ============================================================
   FORM FOOTER
   ============================================================ */
.bhuth-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bhuth-int-gray-50);
    border-radius: 1rem;
    margin-top: 1.5rem;
    border: 1px solid var(--bhuth-int-gray-200);
    flex-wrap: wrap;
}

.bhuth-form-footer .bhuth-int-btn {
    min-width: 180px;
}

/* ============================================================
   RADIO TYPE OPTIONS (SIWES Applicant Type)
   ============================================================ */
.bhuth-type-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 2px solid var(--bhuth-int-gray-200);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
    background: #fff;
}

.bhuth-type-option input {
    display: none;
}

.bhuth-type-option:hover {
    border-color: var(--bhuth-int-primary-300);
    background: var(--bhuth-int-gray-50);
}

.bhuth-type-option:has(input:checked) {
    border-color: var(--bhuth-int-primary-500);
    background: var(--bhuth-int-primary-50);
    color: var(--bhuth-int-primary-700);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ============================================================
   APPLICATION HEADER (Colored per type)
   ============================================================ */
.bhuth-application-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem 2rem;
    border-radius: 1rem;
    color: #fff;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.2);
}

.bhuth-application-header.residency {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.bhuth-application-header.internship {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

.bhuth-application-header.siwes {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

.bhuth-application-header-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.bhuth-application-header h1 {
    font-family: var(--bhuth-int-font-head);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: #fff;
    line-height: 1.2;
}

.bhuth-application-header p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
    color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .bhuth-application-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .bhuth-application-header h1 {
        font-size: 1.25rem;
    }

    .bhuth-steps {
        gap: 0;
    }

    .bhuth-step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .bhuth-step-line {
        min-width: 20px;
    }

    .bhuth-form-section {
        padding: 1.25rem 1rem;
    }

    .bhuth-form-section-title {
        font-size: 1rem;
    }

    .bhuth-form-footer {
        flex-direction: column-reverse;
    }

    .bhuth-form-footer .bhuth-int-btn {
        width: 100%;
    }

    .bhuth-type-option {
        padding: 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .bhuth-steps,
    .bhuth-form-footer,
    .bhuth-file-upload,
    .bhuth-file-remove {
        display: none !important;
    }

    .bhuth-form-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}