/**
 * Form Components - WordPress Plugin Style
 * Input Fields, Checkboxes, Select, Sections
 */

/* ==========================================================================
   Claimant Field Group Containers - WordPress Style
   ========================================================================== */
.claimant-section,
.claimant-field-group {
    background: var(--scs-light-gray);
    border: 1px solid var(--scs-hakone-gold);
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1.5em;
}

.claimant-section-header,
.claimant-field-group-header {
    margin: 0 0 1em 0;
    padding-bottom: 0.5em;
    color: var(--scs-everest-green);
    border-bottom: 2px solid var(--scs-hakone-gold);
    font-size: 1.1em;
    font-weight: 600;
}

.claimant-section-content {
    padding: 0;
}

/* ==========================================================================
   Form Row Layout - WordPress Style
   ========================================================================== */
.form-row {
    margin-bottom: 1em;
}

.form-row label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 500;
    color: var(--scs-everest-green);
    font-size: 14px;
}

.form-row label .required {
    color: var(--scs-red);
    font-weight: bold;
    margin-left: 2px;
}

/* Claimant Info Grid Layout */
.claimant-info,
.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
}

.claimant-info .form-row,
.form-row-grid .form-row {
    margin-bottom: 0;
}

.claimant-info .form-row.full-width,
.form-row-grid .form-row.full-width,
.form-field.full-width {
    grid-column: 1 / -1;
}

/* City/State/ZIP 3-column row */
.city-state-zip {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5em;
    margin-bottom: 0;
}

.city-state-zip > div {
    display: flex;
    flex-direction: column;
}

.city-state-zip label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 500;
    color: var(--scs-everest-green);
    font-size: 14px;
}

/* ==========================================================================
   Form Field Container
   ========================================================================== */
.form-field {
    margin-bottom: 1em;
}

.form-field label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 500;
    color: var(--scs-everest-green);
    font-size: 14px;
}

.field-hint,
.field-help-text {
    font-size: 12px;
    color: var(--scs-gray);
    margin: 0.25em 0 0.5em 0;
    line-height: 1.4;
}

.field-error {
    color: var(--scs-red);
    font-size: 11px;
    display: block;
    margin-top: 2px;
    font-weight: 500;
}

/* ==========================================================================
   Form Inputs - WordPress Style
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea,
.form-input {
    width: 100%;
    padding: 0.5em;
    border: 1px solid var(--scs-border-gray);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fff;
    color: var(--scs-dark-gray);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus,
.form-input:focus {
    border-color: var(--scs-blue);
    outline: none;
    box-shadow: 0 0 0 1px var(--scs-blue);
}

input::placeholder,
textarea::placeholder {
    color: #999;
}

input:disabled,
select:disabled,
textarea:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    color: var(--scs-gray);
}

/* Error State */
input.error,
input.field-error,
select.error,
select.field-error,
textarea.error,
textarea.field-error,
.form-input.error,
.form-input.field-error {
    border: 2px solid var(--scs-red) !important;
    background-color: #fef2f2 !important;
}

input.error:focus,
select.error:focus,
textarea.error:focus {
    box-shadow: 0 0 0 1px var(--scs-red);
}

/* ==========================================================================
   Textarea
   ========================================================================== */
textarea {
    min-height: 100px;
    resize: vertical;
}

/* ==========================================================================
   Select Dropdown
   ========================================================================== */
select {
    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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75em center;
    padding-right: 2.5em;
    cursor: pointer;
}

select::-ms-expand {
    display: none;
}

/* ==========================================================================
   Checkboxes & Radio Buttons - WordPress Style
   ========================================================================== */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    cursor: pointer;
    margin-bottom: 0.5em;
    font-weight: normal;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 0.1em;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--scs-everest-green);
}

.checkbox-label span,
.radio-label span {
    line-height: 1.4;
    user-select: none;
}

/* Vertical Checkbox List */
.checkbox-group,
.checkbox-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    border: 1px solid var(--scs-border-gray);
    border-radius: 4px;
    padding: 12px;
    background: #fff;
}

.checkbox-list-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer;
    padding: 4px 0 !important;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.checkbox-list-item:hover {
    background-color: #f5f5f5;
}

.checkbox-list-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    margin: 0;
}

.checkbox-list-item span {
    font-size: 14px;
    color: #333;
    user-select: none;
    line-height: 1;
}

.checkbox-list-vertical.field-error,
.checkbox-group.field-error {
    border: 2px solid var(--scs-red);
    background-color: #fff5f5;
}

/* Account Type Radio Group */
.account-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.account-type-group .radio-label {
    flex: 0 0 auto;
}

/* ==========================================================================
   Account Information Section
   ========================================================================== */
.account-section {
    background: var(--scs-light-gray);
    border: 1px solid var(--scs-hakone-gold);
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1.5em;
}

.account-section .subsection-title {
    margin-top: 0;
}

/* SSN/TIN Field */
.ssn-field-container {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.ssn-prefix {
    font-weight: 500;
    color: var(--scs-gray);
    font-size: 14px;
}

.ssn-input {
    max-width: 80px;
}

/* ==========================================================================
   Certification Section - WordPress Style
   ========================================================================== */
.certification-section {
    background: var(--scs-light-gray);
    border: 1px solid var(--scs-hakone-gold);
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1.5em;
}

.certification-section .subsection-title,
.certification-section-title {
    margin: 0 0 1em 0;
    padding-bottom: 0.5em;
    color: var(--scs-everest-green);
    border-bottom: 2px solid var(--scs-hakone-gold);
    font-size: 1.1em;
    font-weight: 600;
}

.certification-content {
    margin-bottom: 1em;
    line-height: 1.6;
}

.certification-section .html-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 1em;
    background: #fff;
    border: 1px solid var(--scs-border-gray);
    border-radius: 4px;
    margin-bottom: 1em;
}

.certification-checkbox {
    margin-top: 1em;
}

.certification-checkbox label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
}

.certification-checkbox input[type="checkbox"] {
    margin-right: 0.5em;
    margin-top: 0.25em;
    flex-shrink: 0;
}

/* ==========================================================================
   Signatures Section - WordPress Style
   ========================================================================== */
.signatures-section {
    background: var(--scs-light-gray);
    border: 1px solid var(--scs-hakone-gold);
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1.5em;
}

.signature-field {
    margin-top: 1.5em;
}

.signature-field:first-of-type {
    margin-top: 1em;
}

.signature-field label,
.signature-label {
    display: block;
    margin: 0 0 0.5em 0;
    color: var(--scs-everest-green);
    font-size: 1em;
    font-weight: 600;
}

.signature-instructions {
    margin-bottom: 0.75em;
    line-height: 1.6;
    font-size: 14px;
    color: var(--scs-gray);
}

.signature-field input,
.signature-input {
    width: 100%;
    padding: 0.75em;
    border: 1px solid var(--scs-border-gray);
    border-radius: 4px;
    font-size: 14px;
    font-style: italic;
}

.signature-field input:focus,
.signature-input:focus {
    border-color: var(--scs-everest-green);
    outline: none;
    box-shadow: 0 0 0 1px var(--scs-everest-green);
}

.signature-required {
    margin: 0.5em 0 0 0;
    font-size: 12px;
    color: var(--scs-red);
    font-weight: 500;
}

.signature-date {
    display: flex;
    gap: 1em;
    align-items: center;
    margin-top: 1.5em;
    color: var(--scs-gray);
}

.signature-date label {
    font-weight: 500;
    margin: 0;
}

/* ==========================================================================
   File Upload Section - WordPress Style
   ========================================================================== */
.upload-section {
    margin-top: 1.5em;
}

.upload-zone,
.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2em;
    text-align: center;
    background: var(--scs-light-gray);
    margin: 1em 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover,
.file-upload-area:hover {
    border-color: var(--scs-everest-green);
    background: #e8f5e9;
}

.upload-zone.dragover,
.file-upload-area.dragging {
    border-color: var(--scs-everest-green);
    background: #e8f5e9;
}

.upload-icon {
    color: var(--scs-gray);
    margin-bottom: 1em;
}

.upload-text {
    font-size: 1rem;
    color: var(--scs-dark-gray);
    margin-bottom: 0.5em;
}

.upload-hint,
.drag-drop-text {
    color: var(--scs-gray);
    font-size: 0.9em;
    margin: 0.5em 0;
}

.upload-btn {
    padding: 0.75em 2em;
    background: var(--scs-everest-green);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: #2d3623;
}

/* Uploaded Files List */
.uploaded-files,
.uploaded-files-list {
    margin-top: 1.5em;
}

.uploaded-file,
.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75em;
    margin-bottom: 0.5em;
    background: #fff;
    border: 1px solid var(--scs-border-gray);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.uploaded-file:hover,
.uploaded-file-item:hover {
    background: #f5f5f5;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75em;
    flex: 1;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--scs-everest-green);
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: var(--scs-dark-gray);
    font-size: 0.95em;
}

.file-size {
    font-size: 0.75rem;
    color: var(--scs-gray);
}

.file-remove,
.remove-file {
    background: none;
    border: none;
    color: var(--scs-red);
    cursor: pointer;
    padding: 0.5em;
    font-size: 18px;
    line-height: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0.6;
}

.file-remove:hover,
.remove-file:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Documentation Custom Content */
.documentation-custom-content {
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.documentation-custom-content p {
    margin-bottom: 0.75em;
}

.documentation-custom-content strong {
    font-weight: 600;
    color: #2d3623;
}

.documentation-custom-content ul,
.documentation-custom-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.documentation-custom-content li {
    margin-bottom: 0.5em;
}

/* ==========================================================================
   Help Button
   ========================================================================== */
.help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--scs-everest-green);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 100;
}

.help-button:hover {
    transform: scale(1.1);
    background: #36402a;
}

/* Help Modal Content */
.help-item {
    padding: 1em;
    border-bottom: 1px solid var(--scs-border-gray);
}

.help-item:last-child {
    border-bottom: none;
}

.help-item-title {
    font-weight: 600;
    color: var(--scs-everest-green);
    margin-bottom: 0.5em;
}

.help-item-content {
    color: var(--scs-gray);
    line-height: 1.6;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .claimant-info,
    .form-row-grid {
        grid-template-columns: 1fr;
    }

    .city-state-zip {
        grid-template-columns: 1fr;
    }

    .account-type-group {
        flex-direction: column;
    }
}
