/* ── Hùng Vũ Tra Cứu Hợp Đồng — Frontend CSS ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.hvl-lookup-wrapper {
    font-family: 'Inter', sans-serif;
    max-width: 860px;
    margin: 0 auto;
}

/* ── Form box ─────────────────────────────────────────────────── */
.hvl-lookup-inner {
    border: 2px solid #0ea5e9;
    border-radius: 4px;
    padding: 28px 32px 32px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.08);
}

.hvl-lookup-title {
    color: #0ea5e9;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0 0 22px;
    text-transform: uppercase;
}

/* ── Input fields ─────────────────────────────────────────────── */
.hvl-field-group {
    margin-bottom: 0;
}

/* Wrapper chứa border & background; icon và input là flex children */
.hvl-lookup-wrapper .hvl-input-wrap {
    display: flex !important;
    align-items: stretch !important;
    height: 52px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #fff !important;
    padding: 0 !important;
    gap: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transition: border-color .2s, box-shadow .2s !important;
}

.hvl-lookup-wrapper .hvl-input-wrap:focus-within {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .14) !important;
}

/* Icon: khu vực prefix có background riêng + border phải */
.hvl-lookup-wrapper .hvl-input-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 46px !important;
    flex-shrink: 0 !important;
    color: #0ea5e9 !important;
    font-size: 15px !important;
    background: #f0f9ff !important;
    border-right: 1.5px solid #e5e7eb !important;
    transition: background .2s, color .2s !important;
}

.hvl-lookup-wrapper .hvl-input-wrap:focus-within .hvl-input-icon {
    color: #0284c7 !important;
    background: #e0f2fe !important;
    border-right-color: #bae6fd !important;
}

/* Input: không border, chiếm phần còn lại */
.hvl-lookup-wrapper .hvl-input-wrap input.hvl-input,
.hvl-lookup-wrapper .hvl-input-wrap input[type="tel"],
.hvl-lookup-wrapper .hvl-input-wrap input[type="text"] {
    flex: 1 !important;
    height: 100% !important;
    padding: 0 16px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: #111827 !important;
    font-size: 15px !important;
    font-family: inherit !important;
    line-height: 1 !important;
}

.hvl-lookup-wrapper .hvl-input-wrap input.hvl-input::placeholder {
    color: #9ca3af !important;
    font-size: 14px !important;
}

/* ── Divider ─────────────────────────────────────────────────── */
.hvl-field-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
}

.hvl-field-divider::before,
.hvl-field-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ── Submit button ───────────────────────────────────────────── */
.hvl-btn-search {
    width: 100%;
    height: 52px;
    margin-top: 18px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity .2s, transform .15s, box-shadow .2s;
}

.hvl-btn-search:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14,165,233,.35);
}

.hvl-btn-search:active {
    transform: translateY(0);
    opacity: 1;
}

.hvl-btn-search:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hvl-btn-search i {
    font-size: 16px;
}

/* Spinner from Font Awesome */
.hvl-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Error box ──────────────────────────────────────────────── */
.hvl-error-box {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 500;
}

/* ── Results area ────────────────────────────────────────────── */
.hvl-results {
    margin-top: 24px;
}

.hvl-results-header {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 14px;
    font-weight: 500;
}

/* ── Contract card ───────────────────────────────────────────── */
.hvl-contract-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}

.hvl-contract-card:hover {
    box-shadow: 0 8px 30px rgba(14,165,233,.12);
}

.hvl-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
    color: #fff;
}

.hvl-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.hvl-card-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hvl-card-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    opacity: .85;
    text-transform: uppercase;
}

.hvl-card-code {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.hvl-card-date {
    font-size: 13px;
    opacity: .9;
    white-space: nowrap;
}

/* Card body */
.hvl-card-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hvl-section {}

.hvl-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0ea5e9;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid #e0f2fe;
}

.hvl-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

.hvl-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hvl-row-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hvl-row-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* ── Status Badge ────────────────────────────────────────────── */
.hvl-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.25);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* Biến thể màu theo trạng thái */
.hvl-status-badge.hvl-status-hoạt-động,
.hvl-status-badge.hvl-status-đang-hoạt-động,
.hvl-status-badge.hvl-status-active {
    background: rgba(34,197,94,0.3);
    border-color: rgba(134,239,172,0.5);
}

.hvl-status-badge.hvl-status-đã-thanh-lý,
.hvl-status-badge.hvl-status-thanh-lý,
.hvl-status-badge.hvl-status-closed {
    background: rgba(107,114,128,0.35);
    border-color: rgba(209,213,219,0.5);
}

.hvl-status-badge.hvl-status-quá-hạn,
.hvl-status-badge.hvl-status-trễ-hạn,
.hvl-status-badge.hvl-status-overdue {
    background: rgba(239,68,68,0.3);
    border-color: rgba(252,165,165,0.5);
}

/* ── Overdue / Ontime indicators ─────────────────────────────── */
.hvl-overdue-alert {
    color: #dc2626 !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hvl-overdue-alert i {
    font-size: 13px;
}

.hvl-ontime {
    color: #16a34a !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hvl-ontime i {
    font-size: 13px;
}

/* ── Admin: Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
    .hvl-lookup-inner {
        padding: 20px 18px;
    }

    .hvl-grid-2 {
        grid-template-columns: 1fr;
    }

    .hvl-card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .hvl-card-body {
        padding: 16px 18px;
    }
}
