/* Shared styles for CRB / CSaaS / credit hub screens (admin + web) */

@keyframes creditFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.credit-fade-up {
    animation: creditFadeUp 0.4s ease both;
    animation-delay: calc(var(--credit-i, 0) * 50ms);
}

.credit-step {
    position: relative;
}

.credit-step-num {
    display: inline-flex;
    height: 1.75rem;
    width: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #E8F2FF;
    color: #0063D7;
    font-size: 0.75rem;
    font-weight: 800;
}

.credit-hub-card {
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.credit-hub-card:hover {
    border-color: rgba(0, 99, 215, 0.28);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.credit-hub-form .web-field-error,
.credit-hub-form select.web-field-error,
.credit-hub-form input.web-field-error,
.credit-hub-form textarea.web-field-error {
    border-color: #F87171 !important;
    background-color: #FFF1F2;
}

.credit-hub-form label.error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #B91C1C;
}

.credit-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
    .credit-fade-up,
    .credit-hub-card {
        animation: none;
        transition: none;
        transform: none;
    }
}

/* —— Admin CRB ops console —— */
.crb-admin {
    --crb-blue: #0063D7;
    --crb-ink: #111827;
    --crb-muted: #6B7280;
    --crb-line: #E6E8ED;
}

.crb-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    background:
        radial-gradient(ellipse 80% 120% at 100% 0%, rgba(147, 197, 253, 0.35), transparent 55%),
        linear-gradient(135deg, #0B3A6A 0%, #0063D7 52%, #1D4ED8 100%);
    box-shadow: 0 20px 48px rgba(11, 58, 106, 0.22);
}

.crb-hero__inner {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1.5rem 1.5rem 1.65rem;
}

@media (min-width: 640px) {
    .crb-hero__inner {
        padding: 1.75rem 1.85rem 1.9rem;
    }
}

.crb-hero__aside {
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-bottom: 0.25rem;
}

.crb-hero-orb {
    display: flex;
    height: 5.5rem;
    width: 5.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 1.75rem;
    backdrop-filter: blur(8px);
}

.crb-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
}

.crb-hero-chip--live {
    background: rgba(34, 197, 94, 0.22);
    border-color: rgba(134, 239, 172, 0.45);
}

.crb-hero-chip--stub {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(253, 224, 71, 0.4);
}

.crb-stat {
    border-radius: 1.1rem;
    border: 1px solid var(--crb-line);
    background: #fff;
    padding: 1rem 1.05rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.crb-stat:hover {
    border-color: rgba(0, 99, 215, 0.28);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
    transform: translateY(-2px);
}

.crb-stat__icon {
    display: inline-flex;
    height: 2rem;
    width: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    font-size: 0.75rem;
}

.crb-stat--green .crb-stat__icon { background: #DCFCE7; color: #166534; }
.crb-stat--blue .crb-stat__icon { background: #E8F2FF; color: #0063D7; }
.crb-stat--amber .crb-stat__icon { background: #FEF3C7; color: #B45309; }
.crb-stat--slate .crb-stat__icon { background: #F3F4F6; color: #374151; }

.crb-stat__value {
    margin-top: 0.85rem;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--crb-ink);
}

.crb-flow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    border-radius: 1.1rem;
    border: 1px solid var(--crb-line);
    background: #fff;
    padding: 1rem 1.1rem;
}

@media (min-width: 768px) {
    .crb-flow {
        grid-template-columns: 1fr auto 1fr auto 1fr;
        align-items: center;
        gap: 0.5rem;
        padding: 1.1rem 1.25rem;
    }
}

.crb-flow__step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.crb-flow__num {
    display: inline-flex;
    height: 1.85rem;
    width: 1.85rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #E8F2FF;
    color: #0063D7;
    font-size: 0.75rem;
    font-weight: 800;
}

.crb-flow__sep {
    display: none;
    color: #CBD5E1;
    font-size: 0.7rem;
}

@media (min-width: 768px) {
    .crb-flow__sep {
        display: flex;
        justify-content: center;
    }
}

.crb-panel {
    border-radius: 1.15rem;
    border: 1px solid var(--crb-line);
    background: #fff;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.crb-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #0063D7;
}

.crb-panel__title {
    margin-top: 0.2rem;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--crb-ink);
}

.crb-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crb-muted);
}

.crb-field {
    margin-top: 0.35rem;
    min-height: 3rem;
    width: 100%;
    border-radius: 9999px;
    border: 1px solid var(--crb-line);
    background: #F9FAFB;
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--crb-ink);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.crb-field:focus {
    outline: none;
    border-color: rgba(0, 99, 215, 0.55);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 99, 215, 0.12);
}

.crb-field--sm {
    min-height: 2.5rem;
    font-size: 0.75rem;
}

.crb-btn-primary,
.crb-btn-secondary,
.crb-btn-success {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.crb-btn-primary {
    width: 100%;
    background: #0063D7;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 99, 215, 0.28);
}

.crb-btn-primary:hover {
    background: #0054bd;
    transform: translateY(-1px);
}

.crb-btn-secondary {
    min-height: 2.5rem;
    background: #EEF4FF;
    color: #0063D7;
    font-size: 0.75rem;
}

.crb-btn-secondary:hover {
    background: #DCEBFF;
}

.crb-btn-success {
    min-height: 2.5rem;
    background: #DCFCE7;
    color: #166534;
    font-size: 0.75rem;
}

.crb-btn-success:hover {
    background: #BBF7D0;
}

.crb-setup {
    border-radius: 1.15rem;
    border: 1px solid var(--crb-line);
    padding: 1.25rem 1.35rem;
    background: #fff;
}

.crb-setup--ready {
    border-color: #BBF7D0;
    background: linear-gradient(180deg, #F0FDF4 0%, #fff 42%);
}

.crb-setup--warn {
    border-color: #FECACA;
    background: linear-gradient(180deg, #FEF2F2 0%, #fff 42%);
}

.crb-setup--stub {
    border-color: #FDE68A;
    background: linear-gradient(180deg, #FFFBEB 0%, #fff 42%);
}

.crb-setup__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.crb-setup--ready .crb-setup__badge { background: #DCFCE7; color: #166534; }
.crb-setup--warn .crb-setup__badge { background: #FEE2E2; color: #991B1B; }
.crb-setup--stub .crb-setup__badge { background: #FEF3C7; color: #92400E; }

.crb-setup__list {
    display: grid;
    gap: 0;
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.85);
    overflow: hidden;
}

.crb-setup__list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    font-size: 0.75rem;
    color: var(--crb-muted);
}

.crb-setup__list li:first-child {
    border-top: 0;
}

.crb-setup__list strong {
    color: var(--crb-ink);
    font-weight: 700;
}

.crb-setup__help {
    border-radius: 0.9rem;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.7);
    padding: 0.85rem 0.95rem;
}

.crb-setup__help code {
    border-radius: 0.25rem;
    background: rgba(15, 23, 42, 0.06);
    padding: 0.05rem 0.3rem;
    font-size: 0.65rem;
}

.crb-row__avatar {
    display: inline-flex;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: #F3F4F6;
    color: #4B5563;
    font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .crb-stat,
    .crb-btn-primary {
        transition: none;
        transform: none;
    }
}
