.pvai-container {
    max-width: 600px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.pvai-form-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 50px;
    border: 1px solid #96917a;
    box-shadow: 0 2px 10px #96917a85;
}

.pvai-form-wrapper h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.pvai-form-wrapper p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.pvai-input-group {
    display: flex;
    gap: 10px;
}

#pvai-address-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

#pvai-address-input:focus {
    outline: none;
    border-color: #96917a;
}

.pvai-btn-search {
    padding: 12px 24px;
    background: #96917a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.pvai-btn-search:hover {
    background: #807e3d;
}

.pvai-btn-search:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.pvai-loader {
    display: inline-block;
}

.pvai-results {
    margin-top: 20px;
}

.pvai-result-card {
    background: #f8f9fa;
    border-radius: 0px;
    padding: 20px;
}

.pvai-result-header h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.pvai-result-price,
.pvai-result-sources {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.pvai-result-sources {
    border-bottom: none;
}

.pvai-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.pvai-disclaimer {
    font-size: 10px;
    color: #3a3a3a;
    margin-bottom: 5px;
}

.pvai-value {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.pvai-result-price .pvai-value {
    font-size: 24px;
    color: #9ba142;
}

.pvai-error {
    margin-top: 20px;
    padding: 15px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 8px;
}

.pvai-error p {
    margin: 0;
    color: #c62828;
}

@media (max-width: 600px) {
    .pvai-input-group {
        flex-direction: column;
    }

    .pvai-btn-search {
        width: 100%;
    }
}

.pvai-result-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pvai-result-meta small {
    color: #999;
    font-size: 13px;
}

.pvai-btn-refresh {
    padding: 6px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.pvai-btn-refresh:hover {
    background: #1976D2;
}

.pvai-btn-refresh:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* =============================================
   LOADING SCENE + EMAIL CAPTURE STEP
   ============================================= */

#pvai-step-email {
    text-align: center;
    padding-top: 6px;
}

/* --- House with radar rings --- */
.pvai-loading-scene {
    margin-bottom: 28px;
}

.pvai-house-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 100px;
    margin: 0 auto 14px;
}

/* SVG house */
.pvai-house-svg {
    width: 90px;
    height: 74px;
    position: relative;
    z-index: 2;
    overflow: visible;
    display: block;
}

/* All SVG strokes share base styles */
.pvai-house-svg rect,
.pvai-house-svg polyline {
    fill: none !important;
    stroke: #96917a !important;
    stroke-width: 2.5 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Subtle fill on walls after they're drawn */
.pvai-bd-walls {
    animation: pvai-build-walls 5s ease-in-out infinite;
    stroke-dasharray: 214;
    stroke-dashoffset: 214;
}

/* Roof: starts drawing at 0.6s (12% of 5s) */
.pvai-bd-roof {
    animation: pvai-build-roof 5s ease-in-out infinite;
    stroke-dasharray: 122;
    stroke-dashoffset: 122;
}

/* Door: starts drawing at 1.1s (22%) */
.pvai-bd-door {
    animation: pvai-build-door 5s ease-in-out infinite;
    stroke-dasharray: 86;
    stroke-dashoffset: 86;
}

/* Left window: starts at 1.45s (29%) */
.pvai-bd-win-l {
    animation: pvai-build-win-l 5s ease-in-out infinite;
    stroke-dasharray: 58;
    stroke-dashoffset: 58;
}

/* Right window: starts at 1.65s (33%) */
.pvai-bd-win-r {
    animation: pvai-build-win-r 5s ease-in-out infinite;
    stroke-dasharray: 58;
    stroke-dashoffset: 58;
}

/* Group fades out then resets so the redraw is seamless */
.pvai-house-group {
    animation: pvai-house-fade 5s ease-in-out infinite;
}

@keyframes pvai-house-fade {
    0%    { opacity: 0; }
    4%    { opacity: 1; }
    68%   { opacity: 1; }
    80%   { opacity: 0; }
    100%  { opacity: 0; }
}

/* Walls: 0–16% = 0–0.8s */
@keyframes pvai-build-walls {
    0%    { stroke-dashoffset: 214; }
    16%   { stroke-dashoffset: 0; }
    68%   { stroke-dashoffset: 0; }
    69%   { stroke-dashoffset: 214; }
    100%  { stroke-dashoffset: 214; }
}

/* Roof: 12–24% = 0.6–1.2s */
@keyframes pvai-build-roof {
    0%, 12%  { stroke-dashoffset: 122; }
    24%      { stroke-dashoffset: 0; }
    68%      { stroke-dashoffset: 0; }
    69%      { stroke-dashoffset: 122; }
    100%     { stroke-dashoffset: 122; }
}

/* Door: 22–30% = 1.1–1.5s */
@keyframes pvai-build-door {
    0%, 22%  { stroke-dashoffset: 86; }
    30%      { stroke-dashoffset: 0; }
    68%      { stroke-dashoffset: 0; }
    69%      { stroke-dashoffset: 86; }
    100%     { stroke-dashoffset: 86; }
}

/* Left window: 29–35% = 1.45–1.75s */
@keyframes pvai-build-win-l {
    0%, 29%  { stroke-dashoffset: 58; }
    35%      { stroke-dashoffset: 0; }
    68%      { stroke-dashoffset: 0; }
    69%      { stroke-dashoffset: 58; }
    100%     { stroke-dashoffset: 58; }
}

/* Right window: 33–39% = 1.65–1.95s */
@keyframes pvai-build-win-r {
    0%, 33%  { stroke-dashoffset: 58; }
    39%      { stroke-dashoffset: 0; }
    68%      { stroke-dashoffset: 0; }
    69%      { stroke-dashoffset: 58; }
    100%     { stroke-dashoffset: 58; }
}

.pvai-scan-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #96917a;
    opacity: 0;
    animation: pvai-radar 2.4s ease-out infinite;
}

.pvai-scan-ring-2 {
    animation-delay: 1.2s;
}

@keyframes pvai-radar {
    0%   { transform: scale(0.5); opacity: 0.7; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* --- Cycling status text --- */
.pvai-status-msg {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
    letter-spacing: 0.2px;
    min-height: 18px;
    transition: opacity 0.3s ease;
}

/* --- Indeterminate progress bar --- */
.pvai-progress-bar {
    width: 100%;
    height: 3px;
    background: #ece9e0;
    border-radius: 99px;
    overflow: hidden;
}

.pvai-progress-fill {
    height: 100%;
    width: 40%;
    background: #96917a;
    border-radius: 99px;
    animation: pvai-slide 1.8s ease-in-out infinite;
}

@keyframes pvai-slide {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(160%); }
    100% { transform: translateX(250%); }
}

/* --- Email ask section --- */
.pvai-email-ask {
    border-top: 1px solid #ece9e0;
    padding-top: 22px;
}

.pvai-email-ask-heading {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.pvai-email-row {
    display: flex;
    gap: 8px;
}

.pvai-email-row input[type="email"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.pvai-email-row input[type="email"]:focus {
    outline: none;
    border-color: #96917a;
}

.pvai-no-spam {
    margin: 8px 0 0;
    font-size: 11px;
    color: #bbb;
}

.pvai-input-nudge {
    border-color: #96917a !important;
    animation: pvai-nudge-pulse 1s ease-in-out 3;
}

@keyframes pvai-nudge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(150, 145, 122, 0); }
    50%       { box-shadow: 0 0 0 4px rgba(150, 145, 122, 0.35); }
}


@media (max-width: 500px) {
    .pvai-email-row {
        flex-direction: column;
    }
}

/* =============================================
   ADDRESS AUTOCOMPLETE DROPDOWN
   ============================================= */

#pvai-address-input {
    position: relative;
}

.pvai-ac-dropdown {
    display: none;
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #d0cfc7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    box-sizing: border-box;
}

.pvai-ac-item {
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f0efe9;
    line-height: 1.4;
}

.pvai-ac-item:last-child {
    border-bottom: none;
}

.pvai-ac-item:hover,
.pvai-ac-item:focus {
    background: #f5f4ef;
    outline: none;
}

.pvai-ac-item strong {
    color: #96917a;
    font-weight: 700;
}

/* Make the input wrapper relative so dropdown anchors to it */
.pvai-input-group {
    position: relative;
    flex-wrap: wrap;
}

.pvai-input-group #pvai-address-input {
    position: static;
}

.pvai-input-group .pvai-ac-dropdown {
    top: 100%;
    left: 0;
    /* width matches the input, not the full group */
    width: calc(100% - 130px);
}