/* =============================================
   UK Postcode Address Lookup – Styles
   Designed to inherit your theme's fonts/colors
   and stay minimal. Override as needed.
   ============================================= */

.ukpl-form-wrap {
    max-width: 480px;
    font-family: inherit;
}

/* --- Label --- */
.ukpl-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: inherit;
}

/* --- Input row --- */
.ukpl-input-row {
    display: flex;
    gap: 8px;
}

.ukpl-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: inherit;
}

.ukpl-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* --- Buttons --- */
.ukpl-search-btn,
.ukpl-submit-btn,
.ukpl-change-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.ukpl-search-btn,
.ukpl-submit-btn {
    background: #0073aa;
    color: #fff;
}

.ukpl-search-btn:hover,
.ukpl-submit-btn:hover {
    background: #005f8c;
}

.ukpl-search-btn:disabled,
.ukpl-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ukpl-change-btn {
    background: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
}

.ukpl-change-btn:hover {
    background: rgba(0, 115, 170, 0.06);
}

/* --- Select dropdown --- */
.ukpl-results-wrap {
    margin-top: 12px;
}

.ukpl-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
}

.ukpl-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* --- Error --- */
.ukpl-error {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #d63638;
}

.ukpl-error:empty,
.ukpl-error[hidden] {
    display: none;
}

/* --- Selected address card --- */
.ukpl-selected-state {
    border: 1px solid #0073aa;
    border-radius: 6px;
    padding: 16px;
    background: rgba(0, 115, 170, 0.03);
}

.ukpl-selected-address p {
    margin: 0 0 2px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ukpl-selected-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* --- Loading --- */
.ukpl-loading {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ukpl-loading[hidden] {
    display: none;
}

.ukpl-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: ukpl-spin 0.6s linear infinite;
}

@keyframes ukpl-spin {
    to { transform: rotate(360deg); }
}

/* --- CF7 address display (optional) --- */
.ukpl-cf7-address-display {
    display: none;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #f0f6fc;
    border-left: 3px solid #0073aa;
    border-radius: 3px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Manual entry link (in error messages) --- */
.ukpl-manual-link {
    display: inline-block;
    margin-top: 4px;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.ukpl-manual-link:hover {
    color: #005f8c;
}

/* --- Manual entry form --- */
.ukpl-manual-state {
    border-radius: 6px;
    padding: 25px;
    background: #F1FCED;
}

.ukpl-manual-heading {
    margin: -3px 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
    line-height: 1.1;
}

.ukpl-manual-state .ukpl-field-group {
    justify-content: start;
    align-items: start;
    gap: 5px;
}


.ukpl-manual-state .form-input {
    min-height: 50px;
    font-size: 16px;
    padding: 10px 20px;
    max-width: 100%;
}

.ukpl-manual-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ukpl-field-group {
    display: flex;
    flex-direction: column;
}

.ukpl-field-group .ukpl-label {
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.ukpl-required {
    color: #d63638;
}



.ukpl-postcode-input {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    max-width: 200px;
}

.ukpl-manual-error {
    margin-top: 10px;
}

.ukpl-manual-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .ukpl-input-row {
        flex-direction: column;
    }

    .ukpl-search-btn {
        width: 100%;
    }

    .ukpl-selected-actions {
        flex-direction: column;
    }

    .ukpl-change-btn,
    .ukpl-submit-btn {
        width: 100%;
        text-align: center;
    }

    .ukpl-manual-actions {
        flex-direction: column;
    }

    .ukpl-manual-back-btn,
    .ukpl-manual-submit-btn {
        width: 100%;
        text-align: center;
    }

    .ukpl-postcode-input {
        max-width: 100%;
    }
}
