/**
 * Up&Help RH - Frontend Styles
 * Modern and responsive form design
 *
 * @package UpHelpRH
 */

/* ===== Form Wrapper ===== */
.uphelp-form-wrapper {
    max-width: 720px;
    margin: 30px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ===== Form Description ===== */
.uphelp-form-description {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 32px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.uphelp-form-description h2,
.uphelp-form-description h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.uphelp-form-description p {
    margin: 0;
    font-size: 15px;
    opacity: 0.95;
}

/* ===== Job Info ===== */
.uphelp-form-vaga-info {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 8px;
}

.uphelp-form-vaga-info h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.uphelp-form-vaga-info p {
    margin: 0;
    color: #f8fafc;
    line-height: 1.8;
}

.uphelp-form-vaga-info strong {
    color: #ffffff;
    font-weight: 600;
}

.uphelp-form-vaga-info p span,
.uphelp-form-vaga-info p a {
    color: #ffffff;
}

/* ===== Main Form ===== */
.uphelp-form {
    background: #fff;
    padding: 40px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* When no description, add top radius */
.uphelp-form-wrapper:not(:has(.uphelp-form-description)) .uphelp-form {
    border-radius: 12px;
}

/* ===== Form Fields Container ===== */
.uphelp-form-fields {
    margin-bottom: 24px;
}

/* ===== Individual Field ===== */
.uphelp-form-field {
    margin-bottom: 24px;
}

.uphelp-form-field:last-child {
    margin-bottom: 0;
}

/* ===== Labels ===== */
.uphelp-form-field label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.uphelp-form-field label .required {
    color: #e74c3c;
    margin-left: 2px;
    font-weight: 700;
}

/* ===== Text Inputs ===== */
.uphelp-form input[type="text"],
.uphelp-form input[type="email"],
.uphelp-form input[type="tel"],
.uphelp-form input[type="phone"],
.uphelp-form input[type="number"],
.uphelp-form input[type="date"],
.uphelp-form input[type="url"],
.uphelp-form select,
.uphelp-form textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #2c3e50;
    background-color: #fff;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.uphelp-form input[type="text"]:focus,
.uphelp-form input[type="email"]:focus,
.uphelp-form input[type="tel"]:focus,
.uphelp-form input[type="phone"]:focus,
.uphelp-form input[type="number"]:focus,
.uphelp-form input[type="date"]:focus,
.uphelp-form input[type="url"]:focus,
.uphelp-form select:focus,
.uphelp-form textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.uphelp-form input::placeholder,
.uphelp-form textarea::placeholder {
    color: #95a5a6;
    opacity: 1;
}

/* ===== Textarea ===== */
.uphelp-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* ===== Select Dropdown ===== */
.uphelp-form select {
    cursor: pointer;
    appearance: none;
    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 16px center;
    padding-right: 40px;
}

/* ===== Radio & Checkbox Groups ===== */
.uphelp-radio-group,
.uphelp-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uphelp-radio-option,
.uphelp-checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #2c3e50;
}

.uphelp-radio-option:hover,
.uphelp-checkbox-option:hover {
    background: #e8f4f8;
    border-color: #667eea;
}

.uphelp-radio-option input[type="radio"],
.uphelp-checkbox-option input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.uphelp-radio-option:has(input:checked),
.uphelp-checkbox-option:has(input:checked) {
    background: #e8f0fe;
    border-color: #667eea;
    font-weight: 600;
}

/* ===== File Upload ===== */
.uphelp-form input[type="file"] {
    padding: 12px;
    border: 2px dashed #e1e8ed;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.uphelp-form input[type="file"]:hover {
    border-color: #667eea;
    background: #e8f4f8;
}

/* ===== Help Text ===== */
.uphelp-field-help {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* ===== Required Field Indicator ===== */
.uphelp-form-field.required label::after {
    content: none; /* Required star is already in label */
}

/* ===== Submit Button ===== */
.uphelp-form-submit {
    margin-top: 32px;
    text-align: center;
}

.uphelp-form-button {
    display: inline-block;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #0e0e0e;
    border: 1px solid #262626;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: inherit;
}

.uphelp-form-button:hover {
    background: #1a1a1a;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.uphelp-form-button:active {
    transform: translateY(0);
    background: #0a0a0a;
}

.uphelp-form-button:disabled {
    background: #95a5a6;
    border-color: #7f8c8d;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Messages ===== */
.uphelp-form-messages {
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 8px;
    font-size: 15px;
}

.uphelp-form-messages.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.uphelp-form-messages.success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

/* ===== Success State ===== */
.uphelp-form-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.uphelp-form-success h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 24px;
}

.uphelp-form-success p {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
}

/* ===== Error State ===== */
.uphelp-error {
    background: #fee;
    border-left: 4px solid #e74c3c;
    color: #c33;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

/* ===== Loading State ===== */
.uphelp-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.uphelp-form.loading .uphelp-form-button::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: uphelp-spin 0.6s linear infinite;
}

@keyframes uphelp-spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .uphelp-form-wrapper {
        margin: 20px 16px;
    }

    .uphelp-form-description {
        padding: 24px 20px;
        border-radius: 8px 8px 0 0;
    }

    .uphelp-form {
        padding: 24px 20px;
        border-radius: 0 0 8px 8px;
    }

    .uphelp-form-button {
        width: 100%;
        padding: 16px 32px;
    }

    .uphelp-radio-group,
    .uphelp-checkbox-group {
        gap: 8px;
    }

    .uphelp-radio-option,
    .uphelp-checkbox-option {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .uphelp-form-description {
        padding: 20px 16px;
    }

    .uphelp-form {
        padding: 20px 16px;
    }

    .uphelp-form-description h2,
    .uphelp-form-description h3 {
        font-size: 20px;
    }

    .uphelp-form-vaga-info h3 {
        font-size: 18px;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .uphelp-form-wrapper {
        color: #ecf0f1;
    }

    .uphelp-form {
        background: #2c3e50;
    }

    .uphelp-form-field label {
        color: #ecf0f1;
    }

    .uphelp-form input[type="text"],
    .uphelp-form input[type="email"],
    .uphelp-form input[type="tel"],
    .uphelp-form input[type="phone"],
    .uphelp-form input[type="number"],
    .uphelp-form input[type="date"],
    .uphelp-form select,
    .uphelp-form textarea {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7f;
    }

    .uphelp-radio-option,
    .uphelp-checkbox-option {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7f;
    }

    .uphelp-form-vaga-info {
        background: #34495e;
        color: #ecf0f1;
    }

    .uphelp-form-vaga-info h3,
    .uphelp-form-vaga-info strong {
        color: #ecf0f1;
    }
}

/* ===== Print Styles ===== */
@media print {
    .uphelp-form-submit {
        display: none;
    }

    .uphelp-form {
        box-shadow: none;
    }
}

/* ===== Admission Form ===== */
.uphelp-admission-form-wrapper {
    max-width: 720px;
    margin: 30px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.uphelp-admission-form-wrapper h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #1f2937;
}

.uphelp-admission-form-wrapper .lead-info {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.uphelp-admission-form .form-field {
    margin-bottom: 16px;
}

.uphelp-admission-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.uphelp-admission-form input,
.uphelp-admission-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.uphelp-admission-form .form-submit {
    margin-top: 12px;
}

.uphelp-success {
    padding: 12px 16px;
    background: #ecfdf3;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
}
