/* ============================================================
   Appliance Age Checker 3000 — Public Styles
   Clean B2B design, mobile-first
   ============================================================ */

/* ── Container ─────────────────────────────────────────────── */
.aac-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px 40px;
    color: #1a1a2e;
}

/* ── Header ─────────────────────────────────────────────────── */
.aac-header {
    text-align: center;
    padding: 32px 0 28px;
}

.aac-header-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.aac-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.2;
}

.aac-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ── Form ────────────────────────────────────────────────────── */
.aac-form {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.aac-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.aac-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aac-field--full {
    grid-column: 1 / -1;
}

.aac-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
}

.aac-required {
    color: #ef4444;
    margin-left: 2px;
}

.aac-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.8rem;
}

.aac-input,
.aac-select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    color: #1a1a2e;
    background: #f9fafb;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.aac-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.aac-input:focus,
.aac-select:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.aac-input::placeholder {
    color: #9ca3af;
}

.aac-hint {
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.4;
}

/* ── Submit Button ───────────────────────────────────────────── */
.aac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 28px;
    height: 50px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    width: 100%;
}

.aac-btn--primary {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(29,78,216,0.3);
}

.aac-btn--primary:hover {
    background: #1e40af;
    box-shadow: 0 4px 12px rgba(29,78,216,0.35);
}

.aac-btn--primary:active {
    transform: scale(0.99);
}

.aac-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Error panel ─────────────────────────────────────────────── */
.aac-error {
    margin-top: 16px;
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Result Card ─────────────────────────────────────────────── */
.aac-result {
    margin-top: 24px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    animation: aac-fadeIn 0.3s ease;
}

@keyframes aac-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aac-result-header {
    padding: 20px 24px 16px;
    background: #1a1a2e;
    color: #ffffff;
}

.aac-result-brand {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #93c5fd;
    margin: 0 0 6px;
}

.aac-result-serial {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: 0.04em;
}

.aac-result-model {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
}

/* ── Confidence Badge ────────────────────────────────────────── */
.aac-confidence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 10px;
}

.aac-confidence--high    { background: #dcfce7; color: #15803d; }
.aac-confidence--medium  { background: #fef9c3; color: #854d0e; }
.aac-confidence--low     { background: #ffedd5; color: #9a3412; }
.aac-confidence--unknown { background: #f1f5f9; color: #475569; }

.aac-confidence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.aac-confidence--high    .aac-confidence-dot { background: #16a34a; }
.aac-confidence--medium  .aac-confidence-dot { background: #ca8a04; }
.aac-confidence--low     .aac-confidence-dot { background: #ea580c; }
.aac-confidence--unknown .aac-confidence-dot { background: #94a3b8; }

/* ── Result Body ─────────────────────────────────────────────── */
.aac-result-body {
    padding: 20px 24px;
    background: #ffffff;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.aac-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.aac-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
}

.aac-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.aac-stat-sub {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ── Recommendation Banner ────────────────────────────────────── */
.aac-recommendation {
    margin: 0 24px 20px;
    padding: 14px 18px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.aac-recommendation--repair  { background: #f0fdf4; border: 1px solid #bbf7d0; }
.aac-recommendation--monitor { background: #fffbeb; border: 1px solid #fde68a; }
.aac-recommendation--replace { background: #fff1f2; border: 1px solid #fecdd3; }

.aac-rec-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.aac-rec-action {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 3px;
}

.aac-recommendation--repair  .aac-rec-action { color: #15803d; }
.aac-recommendation--monitor .aac-rec-action { color: #92400e; }
.aac-recommendation--replace .aac-rec-action { color: #be123c; }

.aac-rec-note {
    font-size: 0.875rem;
    color: #374151;
    margin: 0;
    line-height: 1.5;
}

/* ── Warnings ─────────────────────────────────────────────────── */
.aac-warnings {
    margin: 0 24px 20px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

.aac-warnings-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 6px;
}

.aac-warnings ul {
    margin: 0;
    padding: 0 0 0 16px;
}

.aac-warnings li {
    font-size: 0.82rem;
    color: #78350f;
    line-height: 1.5;
}

/* ── Confidence explanation note (MEDIUM) ─────────────────────── */
.aac-confidence-note {
    margin: 0 24px 16px;
    padding: 10px 14px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #78350f;
    line-height: 1.5;
}

/* ── Failure State ─────────────────────────────────────────── */

/* ── Lifespan bar ─────────────────────────────────────────────── */
.aac-lifespan-bar-wrapper {
    grid-column: 1 / -1;
    margin-top: 4px;
}

.aac-lifespan-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    margin-bottom: 8px;
}

.aac-lifespan-bar-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.aac-lifespan-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}

.aac-lifespan-bar-fill--ok      { background: #22c55e; }
.aac-lifespan-bar-fill--monitor { background: #f59e0b; }
.aac-lifespan-bar-fill--replace { background: #ef4444; }

.aac-lifespan-bar-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.aac-result-footer {
    padding: 12px 24px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aac-result-footer-note {
    font-size: 0.75rem;
    color: #9ca3af;
}

.aac-new-search-btn {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4f46e5;
    background: none;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.aac-new-search-btn:hover {
    background: #eef2ff;
    border-color: #818cf8;
}

/* ── Field-level inline errors ───────────────────────────────── */
.aac-field-error {
    color: #dc2626;
    font-size: 0.78rem;
    margin: 4px 0 0;
    font-weight: 500;
}

.aac-input--error,
.aac-select--error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important;
}

/* ── Failure result panel ────────────────────────────────────── */
.aac-result-fail {
    padding: 32px 24px;
    text-align: center;
}
.aac-result-fail-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}
.aac-result-fail h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px;
}
.aac-result-fail-reason {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 6px;
    word-break: break-word;
}
.aac-result-fail-detail {
    font-size: 0.82rem;
    color: #9ca3af;
    margin: 0 0 16px;
}
.aac-result-fail-guidance {
    text-align: left;
    font-size: 0.88rem;
    color: #4b5563;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0 auto 20px;
    max-width: 480px;
}
.aac-result-fail-guidance ul {
    margin: 6px 0 0 18px;
    padding: 0;
}
.aac-result-fail-guidance li {
    margin-bottom: 4px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 520px) {
    .aac-form-grid {
        grid-template-columns: 1fr;
    }
    .aac-field--full {
        grid-column: auto;
    }
    .aac-result-header,
    .aac-result-body,
    .aac-recommendation {
        padding-left: 16px;
        padding-right: 16px;
    }
}
