/* Dashboard Styles - Gehtsoft Form Assistant */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://unpkg.com/primeicons@7.0.0/primeicons.css');

:root {
    --deep-blue: #17479d;
    --clear-blue: #5aa0d8;
    --action-green: #8de37b;
    --white: #ffffff;
    --off-white: #f7f8fa;
    --border: #e2e8f0;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #94a3b8;
    --radius: 12px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.06);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--off-white);
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.dashboard-sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-brand {
    height: 65px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand a {
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--deep-blue);
}
.sidebar-links {
    flex: 1;
    padding: 12px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
}
.sidebar-link:hover { background: var(--off-white); color: var(--text-primary); }
.sidebar-link.active { background: #eef3fb; color: var(--deep-blue); font-weight: 600; }
.sidebar-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-bottom {
    padding: 12px;
    border-top: 1px solid var(--border);
}
.sidebar-logout { color: var(--text-muted); }
.sidebar-logout:hover { color: #dc2626; background: #fef2f2; }

/* 2.1 — Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* 2.1 — Hamburger button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-primary);
    line-height: 1;
}

/* Main content */
.dashboard-main {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
}
.dashboard-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    height: 65px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dashboard-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}
.header-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.dashboard-content { padding: 28px 32px; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 24px;
}

/* Buttons — 6.2 improved hover/active/focus */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    text-decoration: none;
    position: relative;
}
.btn:focus-visible {
    outline: 2px solid var(--clear-blue);
    outline-offset: 2px;
}
.btn-primary { background: var(--deep-blue); color: var(--white); }
.btn-primary:hover { background: #1a52b5; box-shadow: 0 2px 8px rgba(23,71,157,0.25); }
.btn-primary:active { background: #133d80; box-shadow: inset 0 2px 4px rgba(0,0,0,0.15); }
.btn-secondary { background: var(--off-white); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: #edf2f7; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.btn-secondary:active { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: #dc2626; }
.btn-danger:hover { background: #fee2e2; box-shadow: 0 1px 4px rgba(220,38,38,0.12); }
.btn-danger:active { background: #fecaca; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* 2.5 — Button loading state */
.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}
.btn-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    margin-right: 6px;
    flex-shrink: 0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-yellow { background: #fef9c3; color: #a16207; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s;
    background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--deep-blue); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* 5.1 — Readonly input styling */
.form-group input[readonly],
.input-readonly {
    background: #f1f5f9;
    cursor: default;
    color: var(--text-secondary);
}
.form-group input[readonly]:focus { border-color: var(--border); }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.15rem; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* 2.6 — Confirm Modal */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}
.confirm-modal-overlay.open { display: flex; }
.confirm-modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    padding: 28px;
    text-align: center;
}
.confirm-modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.confirm-modal p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}
.confirm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Wizard steps */
.wizard-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.wizard-step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
}
.wizard-step.active { background: var(--deep-blue); }
.wizard-step.done { background: var(--action-green); }
.wizard-section { display: none; }
.wizard-section.active { display: block; }

/* Progress bar — 6.4 animation */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #edf2f7;
    border-radius: 5px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--action-green), var(--clear-blue));
    width: 0;
    transition: width 0.6s ease-out;
}

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.data-table tr:hover { background: var(--off-white); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 24px; max-width: 400px; margin-inline: auto; line-height: 1.6; }

/* Onboarding cards */
.onboarding-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}
.onboarding-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.onboarding-card:hover {
    border-color: var(--deep-blue);
    box-shadow: 0 4px 16px rgba(23,71,157,0.12);
}
.onboarding-card-icon { font-size: 2.5rem; margin-bottom: 12px; }
.onboarding-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.onboarding-card p { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }

/* Assistant card */
.assistant-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 20px 24px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.15s;
}
.assistant-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 16px 40px rgba(0,0,0,0.08); }
.assistant-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.assistant-type-icon.form { background: #eef3fb; }
.assistant-type-icon.chat { background: #f0fdf4; }
.assistant-info { flex: 1; min-width: 0; }
.assistant-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.assistant-meta { font-size: 0.8rem; color: var(--text-muted); }
.assistant-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Embed code */
.embed-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, Menlo, monospace;
    font-size: 0.76rem;
    white-space: pre;
    overflow-x: auto;
    line-height: 1.7;
    position: relative;
}
.embed-code .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.12);
    color: #e2e8f0;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.72rem;
    cursor: pointer;
    z-index: 1;
    transition: background 0.15s, color 0.15s;
}
.embed-code .copy-btn:hover { background: rgba(255,255,255,0.22); }
.embed-code .copy-btn.copied { background: #16a34a; color: var(--white); }
.embed-code .hl-tag { color: #f472b6; }
.embed-code .hl-attr { color: #7dd3fc; }
.embed-code .hl-val { color: #86efac; }
.embed-code .hl-cmt { color: #64748b; font-style: italic; }

/* Stat card */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 24px;
}
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-card-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.stat-card-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* Pricing cards — PrimeVue style */
.pricing-grid {
    display: flex;
    gap: 24px;
    align-items: stretch;
}
.pricing-card {
    flex: 1;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    transition: box-shadow 0.2s;
}
.pricing-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 16px 48px rgba(0,0,0,0.08); }
.pricing-card.current { outline: 2px solid var(--deep-blue); outline-offset: -2px; }
.pricing-card.featured {
    outline: 2px solid var(--deep-blue);
    outline-offset: -2px;
    box-shadow: 0 8px 32px rgba(23,71,157,0.15);
}
.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--deep-blue);
    color: var(--white);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.pricing-card-header { display: flex; flex-direction: column; gap: 8px; min-height: 71px; }
.pricing-card h3 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); }
.pricing-card-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.pricing-divider { width: 100%; height: 1px; background: var(--border); }
.pricing-price-row { display: flex; align-items: baseline; gap: 8px; }
.pricing-price { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.pricing-period { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.pricing-features li { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--text-secondary); }
.pricing-features li .pi { font-size: 1.1rem; color: #16a34a; }
.pricing-cta { width: 100%; justify-content: center; border-radius: 24px; padding: 12px 20px; }

/* 4.2 — Billing toggle */
.billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}
.billing-toggle span { font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); }
.billing-toggle span.active { color: var(--text-primary); font-weight: 600; }
.toggle-switch {
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    border: none;
    padding: 0;
}
.toggle-switch.on { background: var(--deep-blue); }
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.on::after { transform: translateX(22px); }
.billing-save-tag {
    background: #dcfce7;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* 4.3 — Feature comparison table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.comparison-table th {
    padding: 12px 16px;
    text-align: center;
    font-weight: 700;
    background: var(--off-white);
    border-bottom: 2px solid var(--border);
}
.comparison-table th:first-child { text-align: left; }
.comparison-table td {
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
.comparison-table td:first-child { text-align: left; font-weight: 500; color: var(--text-primary); }
.comparison-table .check { color: var(--action-green); font-weight: 700; }
.comparison-table .dash { color: var(--text-muted); }

/* 4.4 — Upgrade nudge banner */
.upgrade-banner {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.88rem;
}
.upgrade-banner-text { color: #92400e; flex: 1; }
.upgrade-banner .btn { flex-shrink: 0; }

/* Toast — 6.3 z-index fix */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: opacity 0.3s, transform 0.3s;
}
.toast-success { background: #f0fdf4; color: #16a34a; }
.toast-error { background: #fef2f2; color: #dc2626; }
.toast-info { background: #eff6ff; color: #2563eb; }
.toast-warning { background: #fef9c3; color: #a16207; }

/* 2.2 — Skeleton loading */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
.skeleton-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 20px 24px;
    margin-bottom: 14px;
}
.skeleton-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w100 { width: 100%; }
.skeleton-line.h24 { height: 24px; }
.skeleton-line.h40 { height: 40px; }
.skeleton-stat {
    height: 80px;
    border-radius: var(--radius);
}

/* 2.3 — Error state with retry */
.error-state {
    text-align: center;
    padding: 60px 20px;
}
.error-state-icon { font-size: 2.5rem; margin-bottom: 12px; color: #dc2626; }
.error-state p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }

/* 2.4 — Session expiry banner */
.session-banner {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    background: #fef9c3;
    border-bottom: 1px solid #fde68a;
    padding: 10px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 200;
    font-size: 0.85rem;
    color: #92400e;
}

/* 6.1 — View transitions */
.view-fade-in {
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Password strength bar */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.password-strength-seg {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.2s;
}
.password-strength-seg.weak { background: #ef4444; }
.password-strength-seg.medium { background: #f59e0b; }
.password-strength-seg.strong { background: #16a34a; }
.password-strength-label {
    font-size: 0.72rem;
    margin-top: 4px;
    color: var(--text-muted);
}

/* Responsive — tablet */
@media (max-width: 1100px) {
    .pricing-grid { flex-wrap: wrap; }
    .pricing-card { flex: 1 1 calc(50% - 12px); min-width: 280px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .settings-grid { flex-wrap: wrap; }
}

/* Responsive — 2.1 mobile navigation */
@media (max-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    .dashboard-sidebar.mobile-open {
        transform: translateX(0);
        z-index: 101;
    }
    .hamburger-btn { display: block; }
    .dashboard-main { margin-left: 0; }
    .dashboard-header { padding: 16px; }
    .dashboard-content { padding: 20px 16px; }
    .onboarding-cards { flex-direction: column; align-items: center; }
    .pricing-grid { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .session-banner { left: 0; }
}
