/* DBMN Account Pages - Shared Styles (GitHub Issue #208) */
/* Dark theme matching dbmn.io — brand tokens from /css/brand.css */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--brand-font-body);
    background: linear-gradient(135deg, var(--brand-bg-start) 0%, var(--brand-bg-end) 100%);
    min-height: 100vh;
    color: var(--brand-text-body);
}

/* Sticky site header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-bg-start) 0%, var(--brand-bg-end) 100%);
    border-bottom: 1px solid var(--brand-border);
}

.site-header a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--brand-text);
}

.site-header img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.site-header h1 {
    font-family: var(--brand-font-heading);
    font-size: 1.25rem;
    color: var(--brand-text);
    margin: 0;
}

/* Dashboard variant: logo left, user context right */
.site-header.has-user {
    justify-content: space-between;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

.header-right a {
    color: var(--brand-accent);
    text-decoration: none;
    font-size: 0.875rem;
}

.header-right a:hover {
    text-decoration: underline;
}

.container {
    max-width: 720px;
    width: 100%;
    padding: 2rem;
    margin: 2rem auto 0 auto;
}

.card {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    padding: 2rem;
}

.card h2 {
    font-size: 1.25rem;
    color: var(--brand-text);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--brand-text);
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select option {
    background: var(--brand-bg-start);
    color: var(--brand-text);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 120, 212, 0.3);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--brand-accent);
    color: var(--brand-text);
    width: 100%;
}

.btn-secondary {
    background: var(--brand-surface);
    color: var(--brand-text-body);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.link-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--brand-text-muted);
}

.link-text a {
    color: var(--brand-accent);
    text-decoration: none;
}

.link-text a:hover {
    text-decoration: underline;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.alert-error {
    background: rgba(255, 69, 58, 0.15);
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: #ff6b6b;
}

.alert-success {
    background: rgba(52, 199, 89, 0.15);
    border: 1px solid rgba(52, 199, 89, 0.3);
    color: #5bd77a;
}

.alert-info {
    background: rgba(0, 120, 212, 0.15);
    border: 1px solid rgba(0, 120, 212, 0.3);
    color: #7ab8ff;
}

.alert-warning {
    background: rgba(255, 214, 10, 0.15);
    border: 1px solid rgba(255, 214, 10, 0.3);
    color: #ffd60a;
}

/* Dashboard styles */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--brand-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--brand-text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--brand-text-muted);
    margin-top: 0.25rem;
}

.license-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.license-trial {
    background: rgba(255, 214, 10, 0.2);
    color: #ffd60a;
}

.license-user {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.license-environment {
    background: rgba(88, 86, 214, 0.2);
    color: #7b79e0;
}

.license-free {
    background: rgba(255, 255, 255, 0.1);
    color: var(--brand-text-muted);
}

.license-lifetime {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

/* License details section */
.license-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.license-detail-row:last-child {
    border-bottom: none;
}

.license-detail-label {
    color: var(--brand-text-muted);
}

.license-detail-value {
    color: var(--brand-text);
    font-weight: 500;
}

.env-url-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.env-url-list li {
    font-size: 0.8rem;
    color: var(--brand-text-body);
    padding: 0.25rem 0;
}

.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 1.5rem 0;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--brand-text);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Progressive Questionnaire ── */

.progress-bar {
    position: sticky;
    top: 57px; /* below site-header */
    z-index: 99;
    background: var(--brand-surface);
    border-bottom: 1px solid var(--brand-border);
    padding: 0.375rem 1.5rem;
    text-align: center;
}

.compact-header ~ .progress-bar {
    top: 42px; /* below compact site-header */
}

.progress-track {
    max-width: 480px;
    margin: 0 auto;
}

.progress-track-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--brand-accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* Step container */
.questionnaire-step {
    display: none;
    animation: stepFadeIn 0.3s ease;
}

.questionnaire-step.active {
    display: block;
}

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

/* Step content */
.step-title {
    font-size: 1.25rem;
    color: var(--brand-text);
    margin-bottom: 0.5rem;
}

.step-subtitle {
    font-size: 0.875rem;
    color: var(--brand-text-muted);
    margin-bottom: 1.5rem;
}

/* Toggle button group (multi-select pills) */
.container-wide {
    max-width: 640px;
    margin-top: 1rem;
}

.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 180px;
    padding: 0.75rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--brand-surface);
    color: var(--brand-text-body);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    user-select: none;
    text-align: center;
}

.toggle-btn:hover {
    border-color: var(--brand-accent);
}

.toggle-btn.active {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: var(--brand-text);
}

/* "Other" textarea revealed when Other toggle is active */
.toggle-other-text {
    display: none;
    margin-top: 0.75rem;
}

.toggle-other-text.visible {
    display: block;
}

/* Step navigation (Back / Next buttons) */
.step-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.step-nav .btn {
    flex: 1;
}

/* Intro step centered layout */
.step-intro {
    text-align: center;
    padding: 1.5rem 0;
}

.step-intro .step-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.step-intro .step-subtitle {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Compact header (questionnaire pages) */
.site-header.compact-header {
    padding: 0.5rem 1.5rem;
}

.site-header.compact-header img {
    width: 28px;
    height: 28px;
}

.site-header.compact-header h1 {
    font-size: 1rem;
}

/* Compact card (questionnaire pages) */
.card-compact {
    padding: 1.25rem;
}

/* Footer */
footer {
    margin-top: 2rem;
    padding-bottom: 2rem;
    opacity: 0.6;
    font-size: 0.9rem;
    text-align: center;
}

footer a {
    color: var(--brand-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.2s;
}

footer a:hover {
    border-color: var(--brand-text);
}
