:root {
    --avd-gradient-start: #1e40af;
    --avd-gradient-mid: #4f46e5;
    --avd-gradient-end: #7c3aed;
    --avd-text: #1e293b;
    --avd-muted: #64748b;
    --avd-radius: 12px;
    --avd-radius-pill: 50px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--avd-text);
    line-height: 1.5;
    background: #f8fafc;
}

body.theme-dark {
    background: #0f172a;
    color: #e2e8f0;
}

.embed-root {
    padding: 16px;
    max-width: 560px;
    margin: 0 auto;
}

.embed-card {
    background: #fff;
    border-radius: var(--avd-radius);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    padding: 20px;
    border: 1px solid #e2e8f0;
}

body.theme-dark .embed-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.embed-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.embed-header img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.embed-header h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.embed-header p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--avd-muted);
}

body.theme-dark .embed-header p {
    color: #94a3b8;
}

.embed-form {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    border-radius: var(--avd-radius-pill);
    padding: 4px;
    border: 1px solid #e2e8f0;
}

body.theme-dark .embed-form {
    background: #0f172a;
    border-color: #334155;
}

.embed-form input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: inherit;
}

.embed-form input::placeholder {
    color: #94a3b8;
}

.embed-form input.is-invalid {
    box-shadow: inset 0 0 0 2px #dc3545;
    border-radius: var(--avd-radius-pill);
}

.embed-form button {
    border: none;
    border-radius: var(--avd-radius-pill);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    background: linear-gradient(135deg, var(--avd-gradient-start), var(--avd-gradient-mid));
    color: #fff;
    transition: opacity 0.2s, transform 0.15s;
}

.embed-form button:hover:not(:disabled) {
    opacity: 0.92;
}

.embed-form button:active:not(:disabled) {
    transform: scale(0.98);
}

.embed-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.embed-result {
    margin-top: 14px;
}

.embed-result .alert {
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--avd-radius);
    font-size: 0.9rem;
}

.embed-result .alert h2 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
}

.embed-result .alert p {
    margin: 0 0 8px;
    font-size: 0.85rem;
}

.embed-result .alert p:last-child {
    margin-bottom: 0;
}

.embed-result .alert ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
}

.embed-result .alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.embed-result .alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.embed-result .alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.embed-result .alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

body.theme-dark .embed-result .alert-info {
    background: #1e3a5f;
    border-color: #2563eb;
    color: #bfdbfe;
}

body.theme-dark .embed-result .alert-success {
    background: #064e3b;
    border-color: #059669;
    color: #a7f3d0;
}

body.theme-dark .embed-result .alert-warning {
    background: #78350f;
    border-color: #d97706;
    color: #fde68a;
}

body.theme-dark .embed-result .alert-danger {
    background: #7f1d1d;
    border-color: #dc2626;
    color: #fecaca;
}

.embed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.embed-actions button {
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.embed-actions .btn-primary {
    background: #059669;
    color: #fff;
}

.embed-actions .btn-secondary {
    background: transparent;
    color: inherit;
    border: 1px solid #cbd5e1;
}

body.theme-dark .embed-actions .btn-secondary {
    border-color: #475569;
}

.embed-brand {
    margin-top: 12px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--avd-muted);
}

body.theme-dark .embed-brand {
    color: #64748b;
}

.embed-brand a {
    color: var(--avd-gradient-mid);
    text-decoration: none;
    font-weight: 500;
}

body.theme-dark .embed-brand a {
    color: #818cf8;
}

.embed-brand a:hover {
    text-decoration: underline;
}

.embed-disclaimer {
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--avd-muted);
    text-align: center;
    line-height: 1.4;
}

body.theme-dark .embed-disclaimer {
    color: #64748b;
}

.embed-disclaimer a {
    color: inherit;
}

.d-none {
    display: none !important;
}

@media (max-width: 480px) {
    .embed-form {
        flex-direction: column;
        border-radius: var(--avd-radius);
    }

    .embed-form button {
        width: 100%;
    }
}
