/* Whitehorse CRM v2 — Frontend Application Form */
.wh-application-form-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

/* ── Sections ── */
.wh-form-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.wh-form-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #F78A24;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #fde0b8;
}

/* ── Field grid ── */
.wh-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.wh-field-full  { grid-column: 1 / -1; }
.wh-field-half  { } /* default 1fr */

.wh-field-group { display: flex; flex-direction: column; gap: 5px; }
.wh-field-group label { font-size: 14px; font-weight: 600; color: #333; }
.wh-required { color: #e74c3c; }

.wh-field-group input,
.wh-field-group select,
.wh-field-group textarea {
    padding: 10px 13px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    background: #fafafa;
    width: 100%;
    box-sizing: border-box;
}
.wh-field-group input:focus,
.wh-field-group select:focus,
.wh-field-group textarea:focus {
    border-color: #2e86c1;
    box-shadow: 0 0 0 3px rgba(46,134,193,.15);
    background: #fff;
}
.wh-field-group input.wh-error,
.wh-field-group select.wh-error,
.wh-field-group textarea.wh-error { border-color: #e74c3c !important; background: #fff5f5 !important; }

.wh-field-error-msg {
    display: block;
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
    font-weight: 600;
    animation: whShake .3s ease-in-out;
}

@keyframes whShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ── Radio buttons ── */
.wh-radio-group { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.wh-radio { display: flex; align-items: center; gap: 7px; font-size: 14px; color: #333; cursor: pointer; font-weight: normal; }
.wh-radio input[type="radio"] { width: auto; margin: 0; }

/* ── Owner 2 section ── */
#wh-owner2-section { border-color: #fde0b8; background: #fef8f0; }

/* ── Bank Statement Upload Slots ── */
.wh-upload-subtitle { font-size: 14px; color: #555; margin: -8px 0 20px; }

.wh-statement-slots { display: flex; flex-direction: column; gap: 12px; }
.wh-statement-slots.wh-error { border: 2px solid #e74c3c; border-radius: 8px; padding: 12px; background: #fff5f5; }

.wh-statement-slot { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 8px; }

.wh-slot-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wh-optional-tag {
    font-size: 11px;
    background: #fff3cd;
    color: #856404;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.wh-slot-upload {
    flex: 1;
    position: relative;
    cursor: pointer;
    min-height: 42px;
}
.wh-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100% !important;
    height: 100%;
    z-index: 2;
    padding: 0 !important;
    border: none !important;
    min-height: 42px;
}
.wh-slot-placeholder {
    padding: 10px 16px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    font-size: 13px;
    color: #888;
    text-align: center;
    background: #fff;
    transition: border-color .2s, background .2s;
}
.wh-slot-upload:hover .wh-slot-placeholder {
    border-color: #F78A24;
    background: #fef8f0;
    color: #F78A24;
}
.wh-slot-filename {
    padding: 9px 14px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    font-size: 13px;
    color: #155724;
    font-weight: 600;
    position: relative;
    z-index: 1;
    pointer-events: none;
}
.wh-slot-uploading {
    padding: 9px 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* ── Terms Section ── */
.wh-terms-section { border-color: #F78A24; }

.wh-terms-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px 24px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 13px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 20px;
}
.wh-terms-box p { margin: 0 0 12px; }
.wh-terms-box p:last-child { margin: 0; }
.wh-notice-text { background: #fff3cd; border-left: 3px solid #ffc107; padding: 10px 14px; border-radius: 0 4px 4px 0; }
.wh-encryption-note { color: #27ae60; font-weight: 600; }

.wh-terms-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: #fef8f0;
    border: 2px solid #fde0b8;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
    margin-bottom: 10px;
}
.wh-terms-check:hover { background: #fce8d0; }
.wh-terms-check input[type="checkbox"] { width: auto !important; margin-top: 2px; transform: scale(1.3); cursor: pointer; }
.wh-terms-check span { font-size: 14px; color: #333; line-height: 1.5; }

/* ── Signature pad (Feature 2) ── */
.wh-signature-section .wh-signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 640px) { .wh-signature-section .wh-signature-grid { grid-template-columns: 1fr; } }
.wh-signature-block label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
.wh-signature-pad-wrap { position: relative; margin-bottom: 8px; }
.wh-signature-pad {
    display: block;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: #fff;
    touch-action: none;
}
.wh-application-form-wrap button.wh-signature-clear {
    margin-top: 6px;
    padding: 6px 12px !important;
    font-size: 12px !important;
    background: #F78A24 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-weight: 600;
    line-height: normal !important;
}
.wh-application-form-wrap button.wh-signature-clear:hover { background: #e07d1f !important; color: #fff !important; }

.wh-accepted-confirm {
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
    padding: 8px 12px;
    background: #d4edda;
    border-radius: 5px;
    display: inline-block;
}

/* ── Submit area ── */
.wh-form-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.6;
}
.wh-form-error .wh-error-list {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: none;
}
.wh-form-error .wh-error-list li {
    position: relative;
    padding-left: 8px;
    margin-bottom: 4px;
}
.wh-form-error .wh-error-list li::before {
    content: "•";
    position: absolute;
    left: -12px;
    color: #e74c3c;
    font-weight: 700;
}

.wh-form-submit { text-align: center; margin: 24px 0 0; }

.wh-application-form-wrap .wh-submit-button {
    background: #F78A24 !important;
    color: #fff !important;
    border: none !important;
    padding: 16px 56px !important;
    font-size: 17px !important;
    font-weight: 700;
    border-radius: 8px !important;
    cursor: pointer;
    transition: background .2s, transform .1s;
    letter-spacing: .5px;
}
.wh-application-form-wrap .wh-submit-button:hover  { background: #e07d1f !important; }
.wh-application-form-wrap .wh-submit-button:active { transform: scale(.98); }
.wh-application-form-wrap .wh-submit-button:disabled { background: #aaa !important; cursor: not-allowed; }

/* ── SMS Consent ── */
.wh-sms-consent {
    margin-top: 20px;
    padding: 18px 24px;
    background: #F78A24;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
}
.wh-sms-consent strong { font-size: 16px; }

/* ── Success message ── */
.wh-form-success-msg {
    text-align: center;
    padding: 48px 24px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
}
.wh-success-icon { font-size: 52px; margin-bottom: 16px; }
.wh-form-success-msg h3 { color: #155724; font-size: 24px; margin: 0 0 10px; }
.wh-form-success-msg p  { color: #155724; font-size: 15px; }

/* ── Datepicker field ── */
.wh-datepicker { cursor: pointer; background: #fff !important; }

/* ── Datepicker — clean white theme ── */
.ui-datepicker {
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    overflow: hidden;
    z-index: 99999 !important;
    width: 300px;
    background: #fff;
}
.ui-datepicker-header {
    background: #fff;
    color: #333;
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    padding: 12px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ui-datepicker-header .ui-datepicker-title {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
    justify-content: center;
}
.ui-datepicker-header .ui-datepicker-title select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
}
.ui-datepicker-header .ui-datepicker-title select:focus { border-color: #999; }
.ui-datepicker-header .ui-datepicker-prev,
.ui-datepicker-header .ui-datepicker-next {
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: auto;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    transition: background .2s, border-color .2s;
    text-align: center;
    line-height: 28px;
}
.ui-datepicker-header .ui-datepicker-prev:hover,
.ui-datepicker-header .ui-datepicker-next:hover { background: #e8e8e8; border-color: #ccc; }
.ui-datepicker-header .ui-datepicker-prev svg,
.ui-datepicker-header .ui-datepicker-next svg { vertical-align: middle; }
.ui-datepicker-header .ui-datepicker-prev .ui-icon,
.ui-datepicker-header .ui-datepicker-next .ui-icon { display: none; }

.ui-datepicker-calendar { margin: 0; border-collapse: collapse; width: 100%; }
.ui-datepicker-calendar th {
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    background: #fff;
    border: none;
}
.ui-datepicker-calendar td {
    padding: 2px;
    text-align: center;
    border: none;
}
.ui-datepicker-calendar td a,
.ui-datepicker-calendar td span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: background .15s, color .15s;
    border: none;
    background: transparent;
}
.ui-datepicker-calendar td a:hover { background: #f0f0f0; color: #111; }
.ui-datepicker-calendar td .ui-state-active { background: #333; color: #fff; font-weight: 700; }
.ui-datepicker-calendar td .ui-state-highlight { background: #f5f5f5; color: #333; font-weight: 600; }
.ui-datepicker-calendar .ui-datepicker-unselectable span { color: #ccc; }
.ui-datepicker-buttonpane { border-top: 1px solid #eee; padding: 8px; background: #fff; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .wh-fields-grid { grid-template-columns: 1fr; }
    .wh-field-full, .wh-field-half { grid-column: 1; }
    .wh-statement-slot { flex-direction: column; align-items: flex-start; }
    .wh-slot-label { min-width: unset; }
    .wh-slot-upload { width: 100%; }
    .wh-submit-button { width: 100%; padding: 15px; }
    .wh-sms-consent { font-size: 13px; }
    .ui-datepicker { width: 280px; }
}
