@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

/* ── Wrapper ── */
.croi-wrap {
    font-family: 'DM Sans', sans-serif;
    max-width: 820px;
    margin: 0 auto 40px;
    color: #1a1f2e;
    box-sizing: border-box;
}
.croi-wrap *, .croi-wrap *::before, .croi-wrap *::after {
    box-sizing: inherit;
}

/* ── Search Bar ── */
.croi-search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 6px 8px 6px 18px;
    gap: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.croi-search-bar:focus-within {
    border-color: #2563eb;
    box-shadow: 0 4px 32px rgba(37, 99, 235, 0.15);
}
.croi-search-icon {
    color: #94a3b8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.croi-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    font-family: 'DM Sans', sans-serif;
    color: #1a1f2e;
    background: transparent;
    padding: 10px 0;
    min-width: 0;
}
.croi-input::placeholder {
    color: #94a3b8;
}
.croi-btn {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 11px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.croi-btn:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.croi-btn:active {
    transform: translateY(0);
}
.croi-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

@keyframes croi-spin {
    to { transform: rotate(360deg); }
}
.croi-spin {
    animation: croi-spin 0.75s linear infinite;
    display: inline-flex;
}

/* ── School List Dropdown ── */
.croi-school-list {
    margin-top: 8px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
}
.croi-school-option {
    padding: 13px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    font-size: 15px;
    gap: 12px;
}
.croi-school-option:last-child {
    border-bottom: none;
}
.croi-school-option:hover {
    background: #eff6ff;
}
.croi-school-option strong {
    color: #1e3a8a;
}
.croi-school-option span {
    font-size: 13px;
    color: #64748b;
    flex-shrink: 0;
}

/* ── Error ── */
.croi-error {
    margin-top: 14px;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 14px 18px;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 500;
}

/* ── Results Panel ── */
@keyframes croi-fadeup {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.croi-results {
    margin-top: 24px;
    animation: croi-fadeup 0.45s ease both;
}

/* ── School Header ── */
.croi-school-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.croi-school-name {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    font-weight: 400;
    color: #0f172a;
    margin: 0 0 4px;
    line-height: 1.2;
}
.croi-school-location {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}
.croi-roi-badge {
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.croi-badge--great { background: #dcfce7; color: #15803d; border: 1.5px solid #86efac; }
.croi-badge--good  { background: #dbeafe; color: #1d4ed8; border: 1.5px solid #93c5fd; }
.croi-badge--fair  { background: #fef9c3; color: #a16207; border: 1.5px solid #fde047; }
.croi-badge--poor  { background: #fee2e2; color: #b91c1c; border: 1.5px solid #fca5a5; }

/* ── Stats Grid ── */
.croi-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.croi-stat-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.croi-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
}
.croi-stat-icon { font-size: 22px; margin-bottom: 10px; }
.croi-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.croi-stat-value {
    font-family: 'DM Serif Display', serif;
    font-size: 26px;
    color: #0f172a;
    margin-bottom: 4px;
}
.croi-stat-sub { font-size: 12px; color: #94a3b8; }

.croi-card--tuition    { border-top: 3px solid #818cf8; }
.croi-card--salary     { border-top: 3px solid #34d399; }
.croi-card--debt       { border-top: 3px solid #f97316; }
.croi-card--completion { border-top: 3px solid #a78bfa; }

/* ── Break-Even Bar ── */
.croi-breakeven-section {
    background: #0f172a;
    border-radius: 18px;
    padding: 26px 28px;
    margin-bottom: 16px;
    color: #ffffff;
}
.croi-breakeven-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.croi-breakeven-title {
    font-weight: 700;
    font-size: 16px;
    color: #e2e8f0;
}
.croi-breakeven-label {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    color: #ffffff;
}
.croi-progress-track {
    background: #1e293b;
    border-radius: 50px;
    height: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}
.croi-progress-bar {
    height: 100%;
    border-radius: 50px;
    width: 0%;
    transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.croi-bar--great { background: linear-gradient(90deg, #4ade80, #22c55e); }
.croi-bar--good  { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.croi-bar--fair  { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.croi-bar--poor  { background: linear-gradient(90deg, #f87171, #ef4444); }

.croi-breakeven-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.croi-breakeven-formula { font-size: 13px; color: #94a3b8; }
.croi-breakeven-verdict { font-size: 13px; font-weight: 600; }
.croi-verdict--great { color: #4ade80; }
.croi-verdict--good  { color: #60a5fa; }
.croi-verdict--fair  { color: #fbbf24; }
.croi-verdict--poor  { color: #f87171; }

/* ── Lifetime Gain ── */
.croi-gain-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1.5px solid #bfdbfe;
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 16px;
}
.croi-gain-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
}
.croi-gain-value {
    font-family: 'DM Serif Display', serif;
    font-size: 36px;
    color: #15803d;
    margin-bottom: 6px;
}
.croi-gain-sub { font-size: 12px; color: #64748b; }

/* ── Attribution ── */
.croi-attribution {
    font-size: 11.5px;
    color: #94a3b8;
    text-align: center;
    margin-top: 10px;
}
.croi-attribution a {
    color: #60a5fb;
    text-decoration: none;
}
.croi-attribution a:hover {
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .croi-school-name    { font-size: 22px; }
    .croi-stats-grid     { grid-template-columns: 1fr 1fr; }
    .croi-stat-value     { font-size: 20px; }
    .croi-gain-value     { font-size: 28px; }
    .croi-btn            { padding: 12px 14px; font-size: 13px; }
    .croi-input          { font-size: 15px; }
    .croi-breakeven-label   { font-size: 22px; }
    .croi-breakeven-section { padding: 20px; }
}
