:root {
    --wb-bg: #0b1220;
    --wb-card: #111827;
    --wb-muted: #94a3b8;
    --wb-text: #e5e7eb;
    --wb-primary: #2563eb;
    --wb-primary-600: #1d4ed8;
    --wb-ring: #60a5fa;
    --wb-chip-bg: #0b2a69;
}

* {
    box-sizing: border-box
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--wb-bg);
    color: var(--wb-text);
    font: 16px/1.45 "Inter", system-ui, Segoe UI, Roboto, sans-serif
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 18, 32, .9);
    backdrop-filter: saturate(1.1) blur(10px);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, .06)
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700
}

.brand .product {
    opacity: .9;
    font-weight: 600
}

.logo {
    height: 22px;
    width: auto;
    display: block;
    border: none
}

/* Logout button styles */
.topnav .link[href="/logout"] {
    color: white;
    text-decoration: none;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s;
}

.topnav .link[href="/logout"]:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.topnav .link[href="/logout"]::before {
    content: '→';
    font-size: 18px;
    transform: rotate(180deg);
    display: inline-block;
}

.container {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 12px
}

.container.narrow {
    max-width: 560px
}

.topnav {
    display: flex;
    align-items: center;
    gap: 10px
}

.org-chip {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(37, 99, 235, .12);
    color: #dbeafe;
    border: 1px solid rgba(37, 99, 235, .35)
}

.card {
    background: var(--wb-card);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28)
}

.section-title {
    margin: 0 0 8px 0;
    font-size: 18px
}

.grid {
    display: grid
}

grid-template-columns: 1fr;

@media (min-width: 1024px) {
    .cols-2 {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Make the form take full width on larger screens */
    #send-form {
        grid-column: 1 / -1;
    }
}

.col-span-2 {
    grid-column: 1 / -1;
}

.gap-sm {
    gap: 12px
}

.row {
    display: flex;
    gap: 12px
}

.between {
    justify-content: space-between
}

.center {
    align-items: center
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px
}

label > span, legend {
    display: block;
    font-size: 12px;
    color: var(--wb-muted);
    margin-bottom: 6px
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: #0f172a;
    color: var(--wb-text);
    border: 1px solid rgba(255, 255, 255, .1);
    outline: none;
    font-size: 18px;
    height: 50px;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    border-color: var(--wb-ring);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .25);
}

/* Form layout */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.form-group {
    flex: 1;
    min-width: 0;
}

.form-label {
    display: block;
    font-size: 12px;
    color: var(--wb-muted);
    margin-bottom: 6px;
}

/* Side toggle buttons */
.side-toggle {
    margin-top: 4px;
}

.radio-group {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 10px;
}

.radio-btn {
    flex: 1;
    position: relative;
    text-align: center;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    transition: background-color 0.2s, color 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--wb-muted);
}

.radio-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-btn span {
    position: relative;
    z-index: 1;
}

.radio-btn input[type="radio"]:checked + span {
    color: white;
}

.radio-btn input[type="radio"]:checked {
    background: var(--wb-primary);
}

.radio-btn:has(input[type="radio"]:checked) {
    background: var(--wb-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
        align-items: flex-end;
        gap: 16px;
    }
    
    .side-toggle {
        margin-top: 0;
        min-width: 180px;
    }
    
    .radio-group {
        height: 50px;
        align-items: center;
    }
}

.btn {
    padding: 10px 14px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    font-weight: 600
}

.btn.primary {
    background: var(--wb-primary);
    color: white;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35)
}

.btn.primary:hover {
    background: var(--wb-primary-600)
}

.btn:active {
    transform: translateY(1px)
}

.btn.full {
    width: 100%
}

.radio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.radio:has(input:checked) {
    background: rgba(37, 99, 235, 0.2);
}

.radio input[type="radio"] {
    width: auto;
    margin: 0;
    padding: 0;
    height: auto;
}

.muted {
    color: var(--wb-muted);

    &.small-center {
        font-size: .75rem;
        line-height: 1rem;
        text-align: center;

        a {
            text-decoration: none;
            color: var(--wb-primary);

            &:hover {
                opacity: .8;
            }
        }
    }
}

figure {
    margin: 0
}

figcaption {
    font-size: 12px;
    color: var(--wb-muted);
    margin-bottom: 6px
}

img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08)
}

.frame {
    background: #0f172a;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .06)
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px
}

.switch input {
    display: none
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #334155;
    border-radius: 28px;
    transition: .2s
}

.slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .2s
}

.switch input:checked + .slider {
    background: var(--wb-primary)
}

.switch input:checked + .slider:before {
    transform: translateX(20px)
}

@media (max-width: 720px) {
    .cols-2 {
        grid-template-columns: 1fr
    }
}
