/* ============================================================
   AI Stock Lens — Calculator UI Styles
   Standalone, no dependencies.
   ============================================================ */

/* ---- Wrapper ---- */
.aslt-calc {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 820px;
    margin: 0 auto 3rem;
}

/* ---- Card ---- */
.aslt-card {
    background: #fff;
    border: 1px solid #E0E7EF;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.07);
    margin-bottom: 1.5rem;
}

/* ---- Form grid ---- */
.aslt-grid {
    display: grid;
    gap: 1.25rem;
}

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

@media (max-width: 640px) {
    .aslt-grid--2 { grid-template-columns: 1fr; }
    .aslt-card     { padding: 1.25rem; }
}

/* ---- Field ---- */
.aslt-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.aslt-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: .02em;
}

.aslt-field__hint {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: 0.25rem;
}

/* ---- Input + prefix ---- */
.aslt-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    overflow: hidden;
    background: #F9FAFB;
    transition: border-color 200ms;
}

.aslt-input-wrap:focus-within {
    border-color: #1565C0;
    background: #fff;
}

.aslt-input-wrap.has-error { border-color: #DC2626; }

.aslt-prefix, .aslt-suffix {
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6B7280;
    background: #F3F4F6;
    align-self: stretch;
    display: flex;
    align-items: center;
    border-right: 1px solid #E5E7EB;
    white-space: nowrap;
}

.aslt-suffix { border-right: none; border-left: 1px solid #E5E7EB; }

.aslt-input-wrap input[type="number"],
.aslt-input-wrap input[type="text"],
.aslt-input-wrap select {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.6875rem 0.875rem;
    font-size: 0.9375rem;
    color: #111827;
    font-family: inherit;
    min-width: 0;
    -moz-appearance: textfield;
}

.aslt-input-wrap input[type="number"]::-webkit-outer-spin-button,
.aslt-input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.aslt-error-msg {
    font-size: 0.75rem;
    color: #DC2626;
    margin-top: 0.25rem;
    display: none;
}
.aslt-error-msg.visible { display: block; }

/* ---- Range slider ---- */
.aslt-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.aslt-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(to right, #1565C0 var(--val, 50%), #E5E7EB var(--val, 50%));
    cursor: pointer;
    outline: none;
}

.aslt-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1565C0;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
}

.aslt-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1565C0;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
}

.aslt-slider-val {
    min-width: 48px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1565C0;
}

/* ---- CTA Button ---- */
.aslt-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #1565C0;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 200ms, transform 100ms;
    margin-top: 0.5rem;
}

.aslt-btn:hover  { background: #0D47A1; }
.aslt-btn:active { transform: scale(.98); }

/* ---- Results ---- */
.aslt-results {
    display: none;
    animation: aslt-fadein 300ms ease;
}

.aslt-results.visible { display: block; }

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

/* Summary row */
.aslt-result-summary {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.5rem;
}

.aslt-result-box {
    background: #F0F4FF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
}

.aslt-result-box--primary {
    background: linear-gradient(135deg, #1565C0, #1976D2);
    border-color: #1565C0;
    color: #fff;
}

.aslt-result-box__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6B7280;
    margin-bottom: 0.375rem;
}

.aslt-result-box--primary .aslt-result-box__label { color: rgba(255,255,255,.8); }

.aslt-result-box__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1565C0;
    line-height: 1.2;
}

.aslt-result-box--primary .aslt-result-box__value { color: #fff; }

/* Donut chart placeholder */
.aslt-chart-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.aslt-donut {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.aslt-donut svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.aslt-donut__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #6B7280;
}

.aslt-donut__center strong {
    font-size: 1.125rem;
    font-weight: 800;
    color: #1565C0;
}

.aslt-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aslt-legend li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.75rem;
}

.aslt-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- Breakdown table ---- */
.aslt-breakdown {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.aslt-breakdown th {
    background: #F0F4FF;
    padding: 0.625rem 0.875rem;
    text-align: left;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #BFDBFE;
}

.aslt-breakdown td {
    padding: 0.5rem 0.875rem;
    border-bottom: 1px solid #F3F4F6;
    color: #374151;
}

.aslt-breakdown tr:last-child td { border-bottom: none; }

.aslt-breakdown-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    margin-top: 1rem;
}

/* Toggle details */
.aslt-details-toggle {
    background: none;
    border: none;
    color: #1565C0;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 1rem;
    font-family: inherit;
}

.aslt-details-toggle:hover { text-decoration: underline; }

.aslt-details {
    display: none;
    margin-top: 1rem;
}

.aslt-details.visible { display: block; }

/* ---- Formula box ---- */
.aslt-formula {
    background: #F8FAFF;
    border: 1px solid #BFDBFE;
    border-left: 4px solid #1565C0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.aslt-formula__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #1565C0;
    margin-bottom: 0.5rem;
}

.aslt-formula code {
    display: block;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #1A1A2E;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---- SEO content section ---- */
.aslt-seo-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #E5E7EB;
}

.aslt-seo-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 0.75rem;
}

.aslt-seo-section p {
    font-size: 0.9375rem;
    color: #4B5563;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.aslt-seo-section ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.aslt-seo-section li {
    font-size: 0.9375rem;
    color: #4B5563;
    line-height: 1.7;
    margin-bottom: 0.375rem;
}
