/* Outer shell just for this page */
.ai-shell {
    background-color: #f5f5f7;
    width: 100%;
    padding: 2rem 1rem 4rem 1rem;
    display: flex;
    justify-content: center;
}


/* Two-column responsive wrapper */
.ai-wrapper {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 900px) {
    .ai-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}


/* Card surface */
.ai-card {
    background-color: #fff;
    border-radius: 16px;
    border: 1px solid #dcdcdc;
    box-shadow: 0 30px 80px -10px rgba(0,0,0,0.12);
    padding: 1.5rem 1.5rem 2rem 1.5rem;
}
.ai-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    margin: 0 0 .25rem 0;
}
.ai-card-subtitle {
    font-size: .9rem;
    line-height: 1.4;
    color: #555;
    margin: 0 0 1.25rem 0;
}
.ai-muted {
    color: #555;
}
.ai-small {
    font-size: .8rem;
    line-height: 1.4;
}


/* Form styles */
.ai-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.ai-form-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.ai-label {
    font-size: .8rem;
    font-weight: 600;
    color: #111;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
}
.ai-label-row {
    justify-content: space-between;
}
.ai-label-hint {
    font-size: .7rem;
    font-weight: 400;
    color: #777;
}
.ai-input,
.ai-textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #bbb;
    background-color: #fafafa;
    padding: .6rem .75rem;
    font-size: .9rem;
    color: #111;
    font-family: inherit;
    line-height: 1.3;
    outline: none;
    box-sizing: border-box;
}
.ai-input:focus,
.ai-textarea:focus {
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74,222,128,0.3);
    background-color: #fff;
}
.ai-textarea {
    min-height: 110px;
    resize: vertical;
}
.ai-hint {
    font-size: .7rem;
    color: #777;
    line-height: 1.3;
}


/* Error box */
.ai-error {
    background: rgba(255,0,0,0.08);
    border: 1px solid rgba(255,0,0,0.4);
    border-radius: 8px;
    color: #b00020;
    font-size: .75rem;
    font-weight: 500;
    padding: .5rem .75rem;
    line-height: 1.3;
}


/* Primary button */
.ai-button {
    cursor: pointer;
    border: 0;
    border-radius: 12px;
    padding: .75rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
    color: #000;
    background-color: #4ade80;
    box-shadow: 0 20px 50px -8px rgba(16,185,129,.55), 0 2px 4px rgba(0,0,0,.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
}
.ai-button:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.ai-button-icon {
    font-size: 1rem;
    line-height: 1;
}
.ai-button-text {
    display: inline-block;
}
.ai-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.4);
    border-top-color: transparent;
    animation: ai-spin .7s linear infinite;
}
@keyframes ai-spin {
    to { transform: rotate(360deg); }
}


/* Disclaimer text */
.ai-disclaimer {
    text-align: center;
    font-size: .7rem;
    color: #999;
    margin: 0;
    line-height: 1.4;
}


/* "What we flag" box */
.ai-flag-box {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-top: 1.5rem;
    padding: 1rem 1rem .75rem 1rem;
}
.ai-flag-title {
    font-size: .8rem;
    font-weight: 600;
    color: #111;
    margin: 0 0 .5rem 0;
}
.ai-flag-list {
    padding-left: 1rem;
    margin: 0;
    font-size: .75rem;
    color: #444;
    line-height: 1.4;
}
.ai-flag-list li {
    margin-bottom: .4rem;
}


/* Results card section */
.ai-results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.ai-results-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}
.ai-results-company {
    margin: .25rem 0 0 0;
    font-size: .8rem;
    line-height: 1.3;
}


/* Severity badge */
.ai-severity-badge {
    font-size: .6rem;
    font-weight: 600;
    line-height: 1;
    padding: .4rem .5rem;
    border-radius: .5rem;
    min-width: 70px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ai-sev-high {
    background-color: #dc2626;
    color: #fff;
    box-shadow: 0 10px 25px -4px rgba(220,38,38,.4);
}
.ai-sev-medium {
    background-color: #facc15;
    color: #000;
    box-shadow: 0 10px 25px -4px rgba(250,204,21,.4);
}
.ai-sev-low {
    background-color: #16a34a;
    color: #fff;
    box-shadow: 0 10px 25px -4px rgba(16,163,74,.4);
}


/* Score block */
.ai-score-block {
    margin-bottom: 1rem;
}
.ai-score-row {
    font-size: .7rem;
    color: #444;
    font-weight: 500;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: .4rem;
}
.ai-score-label {
    color: #444;
}
.ai-score-number {
    color: #000;
    font-size: .8rem;
    font-weight: 600;
}
.ai-score-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background-color: #e5e7eb;
    overflow: hidden;
}
.ai-score-fill {
    height: 100%;
    border-radius: 999px;
    background-color: #4ade80;
    width: 0%;
    transition: width .3s ease;
}


/* Summary box */
.ai-summary-block {
    background-color: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: .75rem .9rem;
    margin-bottom: 1rem;
}
.ai-summary-text {
    font-size: .8rem;
    line-height: 1.4;
    margin: 0;
    color: #333;
}


/* Findings list */
.ai-findings-block {
    margin-bottom: 1rem;
}
.ai-findings-title {
    font-size: .8rem;
    font-weight: 600;
    color: #000;
    margin: 0 0 .5rem 0;
}
.ai-findings-list {
    display: grid;
    gap: .75rem;
}
.ai-finding-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .75rem .9rem;
}
.ai-finding-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: .4rem;
}
.ai-finding-title {
    color: #000;
    font-size: .8rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.ai-finding-risk {
    font-size: .6rem;
    font-weight: 600;
    line-height: 1;
    padding: .3rem .4rem;
    border-radius: .4rem;
    text-transform: uppercase;
    min-width: 55px;
    text-align: center;
}
.ai-risk-high {
    background-color: rgba(220,38,38,.08);
    color: #b91c1c;
    border: 1px solid rgba(220,38,38,.4);
}
.ai-risk-medium {
    background-color: rgba(250,204,21,.12);
    color: #a16207;
    border: 1px solid rgba(250,204,21,.4);
}
.ai-risk-low {
    background-color: rgba(22,163,74,.1);
    color: #15803d;
    border: 1px solid rgba(16,185,129,.4);
}
.ai-finding-desc {
    color: #444;
    font-size: .75rem;
    line-height: 1.4;
    margin: 0;
}


/* tiny helper */
.hidden {
    display: none;
}
