/* Import Bootstrap Icons */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css");

/* Import Outfit font for Landing page */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
    /* Legacy tokens (used by existing views — migrate view-by-view) */
    --primary: #3498db;
    --secondary: #2c3e50;
    --light: #252a33;
    --dark: #1a1d24;
    --text: #e1e1e1;
    --text-secondary: #b0b7c3;
    --border: #2f3541;

    /* New design system (from Landing v2 — adopt per view) */
    --tl-bg: #1b1d23;
    --tl-bg-raised: #22242b;
    --tl-bg-hover: #282a32;
    --tl-border: #2e3038;
    --tl-border-light: #383a44;
    --tl-text: #edeae5;
    --tl-text-muted: #85858c;
    --tl-text-dim: #5c5c64;
    --tl-accent: #f5a623;
    --tl-accent-soft: rgba(245, 166, 35, 0.10);
    --tl-accent-border: rgba(245, 166, 35, 0.25);
    --tl-purple: #818cf8;
    --tl-purple-soft: rgba(129, 140, 248, 0.10);
    --tl-green: #34d399;
    --tl-green-soft: rgba(52, 211, 153, 0.10);
    --tl-coral: #f87171;
    --tl-coral-soft: rgba(248, 113, 113, 0.10);
    --tl-radius-sm: 12px;
    --tl-radius-md: 20px;
    --tl-radius-lg: 24px;
    --tl-radius-pill: 100px;
    --tl-font: 'Outfit', sans-serif;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--tl-bg);
    color: #eee;
}

a, .btn-link {
    color: #5aa6e6;
}

/* Custom Button Styles */
.btn,
.timelane-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn::after,
.timelane-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.btn:hover,
.timelane-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn:hover::after,
.timelane-btn:hover::after {
    transform: translateY(0);
}

.btn:active,
.timelane-btn:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Primary Button */
.btn-primary,
.timelane-btn-primary {
    background: linear-gradient(135deg, #3498db, #2c5082);
    color: white;
}

.btn-primary:hover,
.timelane-btn-primary:hover {
    background: linear-gradient(135deg, #3ea1e6, #2c5082);
    color: white;
}

/* Secondary Button */
.btn-secondary,
.timelane-btn-secondary {
    background: linear-gradient(135deg, #444, #333);
    color: #eee;
}

.btn-secondary:hover,
.timelane-btn-secondary:hover {
    background: linear-gradient(135deg, #555, #444);
    color: #eee;
}

/* Info Button */
.btn-info,
.timelane-btn-info {
    background: linear-gradient(135deg, #226644, #184f34);
    color: #eee;
}

.btn-info:hover,
.timelane-btn-info:hover {
    background: linear-gradient(135deg, #2a7a51, #226644);
    color: #eee;
}

/* Danger Button */
.btn-danger,
.timelane-btn-danger {
    background: linear-gradient(135deg, #772222, #661919);
    color: #eee;
}

.btn-danger:hover,
.timelane-btn-danger:hover {
    background: linear-gradient(135deg, #8a2828, #772222);
    color: #eee;
}

/* Outline Buttons */
.btn-outline-primary,
.timelane-btn-outline-primary {
    background-color: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.btn-outline-primary:hover,
.timelane-btn-outline-primary:hover {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: #3ea1e6;
    color: #3ea1e6;
}

.btn-outline-secondary,
.timelane-btn-outline-secondary {
    background-color: transparent;
    color: #aaa;
    border: 2px solid #aaa;
    box-shadow: 0 2px 8px rgba(170, 170, 170, 0.1);
}

.btn-outline-secondary:hover,
.timelane-btn-outline-secondary:hover {
    background-color: rgba(170, 170, 170, 0.1);
    border-color: #bbb;
    color: #bbb;
}

/* Button Sizes */
.btn-sm,
.timelane-btn-sm {
    padding: 0.25rem 1rem;
    font-size: 0.875rem;
}

.btn-lg,
.timelane-btn-lg {
    padding: 0.875rem 2.5rem;
    font-size: 1.25rem;
}

/* Block Buttons */
.btn-block,
.timelane-btn-block {
    display: flex;
    width: 100%;
}

/* Outline Button */
.timelane-btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.timelane-btn-outline:hover {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: #3ea1e6;
    color: #3ea1e6;
}

.btn:focus, 
.btn:active:focus, 
.btn-link.nav-link:focus, 
.form-control:focus, 
.form-check-input:focus,
.timelane-btn:focus {
  box-shadow: 0 0 0 0.1rem #333, 0 0 0 0.25rem #3498db;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e55858;
}

.validation-message {
    color: #e55858;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45OTMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: #888;
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Dark Mode Styles */
.table {
    color: #ddd !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #2a2a2a !important;
    color: #eee !important;
}

.table-striped > tbody > tr:nth-of-type(even) {
    background-color: #232323 !important;
    color: #eee !important;
}

.table-striped > tbody > tr:hover {
    background-color: #333 !important;
}

.table thead {
    background-color: #2c2c2c !important;
}

.modal-content {
    background-color: #333 !important;
    color: #eee !important;
    border-color: #444 !important;
}

.modal-header {
    border-bottom-color: #444 !important;
}

.modal-footer {
    border-top-color: #444 !important;
}

.form-control, .form-select {
    background-color: #444 !important;
    color: #eee !important;
    border-color: #555 !important;
}

.form-control:focus, .form-select:focus {
    background-color: #444 !important;
    color: #eee !important;
    border-color: #2c5082 !important;
    box-shadow: 0 0 0 0.25rem rgba(44, 80, 130, 0.25) !important;
}

.input-group-text {
    background-color: #555 !important;
    color: #eee !important;
    border-color: #666 !important;
}

.alert-info {
    background-color: #1e3a5f !important;
    color: #eee !important;
    border-color: #2c5082 !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.alert {
    background-color: #1e3a5f !important;
    color: #eee !important;
    border-color: #2c5082 !important;
}

/* Adding to the existing dark mode styles */

/* Fix for card text being unreadable */
.card {
    background-color: #2a2a2a !important;
    color: #eee !important;
    border-color: #444 !important;
}

/* Fix time dropdown background */
input[type="time"], 
input[type="date"],
input[type="datetime-local"] {
    background-color: #444 !important;
    color: #eee !important;
    border-color: #555 !important;
}

/* Fix for any remaining form elements */
select, 
option {
    background-color: #444 !important;
    color: #eee !important;
}

/* Ensure modal backdrops are dark */
.modal-backdrop {
    background-color: #000 !important;
}

/* Add styles for pagination if used */
.pagination > li > a,
.pagination > li > span {
    background-color: #333 !important;
    border-color: #555 !important;
    color: #eee !important;
}

.pagination > .active > a, 
.pagination > .active > span {
    background-color: #2c5082 !important;
    border-color: #1e3a5f !important;
}

/* Fix table styling - more specific selectors to override Bootstrap */
table.table,
.table,
table {
    background-color: #222 !important;
    color: #ffffff !important; /* Brighter white text */
    border-color: #444 !important;
}

table.table > thead > tr > th,
.table > thead > tr > th,
table > thead > tr > th {
    background-color: #1e1e1e !important;
    color: #ffffff !important; /* Brighter white text */
    border-color: #444 !important;
    border-bottom: 2px solid #444 !important;
    font-weight: 600 !important; /* Make headers slightly bolder */
}

table.table > tbody > tr > td,
.table > tbody > tr > td,
table > tbody > tr > td {
    border-color: #444 !important;
    background-color: transparent !important;
    color: #ffffff !important; /* Brighter white text */
}

/* Fix for table-striped rows */
.table-striped > tbody > tr:nth-of-type(odd),
table.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #252525 !important;
    color: #ffffff !important; /* Brighter white text */
}

.table-striped > tbody > tr:nth-of-type(even),
table.table-striped > tbody > tr:nth-of-type(even) {
    background-color: #2a2a2a !important;
    color: #ffffff !important; /* Brighter white text */
}

/* Fix time/date inputs with higher specificity */
input[type="time"],
input[type="date"],
input[type="datetime-local"],
.form-control[type="time"],
.form-control[type="date"],
.form-control[type="datetime-local"],
input.form-control[type="time"],
input.form-control[type="date"],
input.form-control[type="datetime-local"] {
    background-color: #333 !important;
    color: #eee !important;
    border-color: #555 !important;
}

/* Fix time/date input dropdowns */
::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* Style DateTime picker dropdown */
.calendar-popup,
.time-popup,
.datetime-popup {
    background-color: #333 !important;
    color: #eee !important;
    border-color: #555 !important;
}

/* Fix input placeholders */
::placeholder {
    color: #888 !important;
    opacity: 1 !important;
}

/* Dark mode styling for date/time picker popup elements */

/* Invert calendar icon colors */
::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.8) !important;
    background-color: transparent !important;
}

/* Target Chrome/Edge date input popup styling */
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    background-color: transparent !important;
    color-scheme: dark !important;
}

/* Force dark color scheme for datetime pickers */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"] {
    color-scheme: dark !important;
}

/* Ensure dark background for any popup content */
::-webkit-datetime-edit,
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-year-field,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-minute-field,
::-webkit-datetime-edit-second-field,
::-webkit-datetime-edit-ampm-field,
::-webkit-datetime-edit-week-field,
::-webkit-inner-spin-button,
::-webkit-calendar-picker-indicator,
::-webkit-clear-button {
    color: #eee !important;
    background-color: transparent !important;
}

/* Custom styles for Firefox date/time pickers */
@-moz-document url-prefix() {
    input[type="date"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="time"],
    input[type="week"] {
        background-color: #333 !important;
        color: #eee !important;
    }
}

/* Additional control for date picker styling in all browsers */
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus {
    color: #eee !important;
    background-color: #333 !important;
    border-color: #2c5082 !important;
    box-shadow: 0 0 0 0.25rem rgba(44, 80, 130, 0.25) !important;
}

/* For browsers that support it, force dark UI controls */
@supports (color-scheme: dark) {
    input[type="date"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    select {
        color-scheme: dark;
    }
}

/* Dark mode styling for browser autocomplete dropdowns - consolidated rules */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #2c3e50 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
}

/* Chrome, Safari, Edge autofill background */
input.form-control:-webkit-autofill {
    background-color: #2c3e50 !important;
}

/* Firefox specific autofill styling */
@-moz-document url-prefix() {
    input.form-control:-moz-autofill,
    input.form-control:-moz-autofill-preview {
        background-color: #2c3e50 !important;
        color: #ffffff !important;
    }
}

/* Style for the autocomplete options */
input:-webkit-autofill-selected {
    background-color: #34495e !important;
    color: #ffffff !important;
}

/* Fix for selected text color in inputs */
::selection {
    background-color: #2c5082 !important;
    color: #ffffff !important;
}

/* Ensure text color is white when autocompleted and selected */
input::selection,
input::-moz-selection {
    background-color: #2c5082 !important;
    color: #ffffff !important;
}

/* Fix for Chrome/Safari/Edge selected text in autocompleted fields */
input:-webkit-autofill::selection {
    background-color: #2c5082 !important;
    color: #ffffff !important;
}

/* Additional styling for input text color */
input, select, textarea {
    color: #ffffff !important;
}

/* Disable spell check and text suggestions red underlines */
input, textarea {
    spellcheck: false !important;
    -webkit-spell-check: none !important;
    -ms-spellcheck: false !important;
}

/* Force autocomplete dropdown styling - more aggressive approach */
input:-webkit-autofill option,
datalist option,
input option {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
}

/* Additional selector for autofill dropdown items */
option, select option {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
}

/* ── Legal pages (Privacy, Impressum, Disclaimer) ── */
.legal-wrap {
    font-family: var(--tl-font);
    background: var(--tl-bg);
    color: var(--tl-text);
    min-height: 100vh;
    padding: 60px 24px 80px;
}

.legal-container {
    max-width: 720px;
    margin: 0 auto;
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tl-border);
}

.legal-header h1 {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin: 0;
}

.legal-back {
    background: transparent;
    border: 1px solid var(--tl-border-light);
    color: var(--tl-text-muted);
    padding: 8px 20px;
    border-radius: var(--tl-radius-pill);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--tl-font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.legal-back:hover {
    color: var(--tl-text);
    border-color: var(--tl-text-muted);
}

.legal-intro {
    font-size: 17px;
    color: var(--tl-text-muted);
    line-height: 1.7;
    margin-bottom: 40px;
}

.legal-body section {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--tl-border);
}

.legal-body section:last-of-type {
    border-bottom: none;
}

.legal-body h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--tl-accent);
    margin-bottom: 16px;
}

.legal-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--tl-text);
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-body p {
    font-size: 15px;
    color: var(--tl-text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-body a {
    color: var(--tl-accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.legal-body a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.legal-body ul {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.legal-body ul li {
    font-size: 15px;
    color: var(--tl-text-muted);
    line-height: 1.7;
    padding: 6px 0 6px 28px;
    position: relative;
}

.legal-body ul li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: var(--tl-accent);
    font-weight: 600;
}

.legal-updated {
    font-size: 13px;
    color: var(--tl-text-dim);
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--tl-border);
}

@media (max-width: 640px) {
    .legal-wrap {
        padding: 40px 16px 60px;
    }

    .legal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* ── Auth pages (Login, Verify) ── */
.auth-wrap {
    font-family: var(--tl-font);
    background: var(--tl-bg);
    color: var(--tl-text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(245, 166, 35, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-card {
    background: var(--tl-bg-raised);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius-lg);
    padding: 48px 40px;
    width: 420px;
    max-width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 24px;
    background: var(--tl-accent-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo img {
    width: 26px;
    height: 26px;
    filter: sepia(1) saturate(3) hue-rotate(5deg) brightness(1.1);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--tl-text);
}

.auth-subtitle {
    font-size: 15px;
    color: var(--tl-text-muted);
    margin: 0 0 32px;
    line-height: 1.6;
}

.auth-subtitle strong {
    color: var(--tl-accent);
}

.auth-field {
    text-align: left;
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tl-text-muted);
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--tl-bg);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius-sm);
    color: var(--tl-text);
    font-size: 15px;
    font-family: var(--tl-font);
    transition: border-color 0.2s;
    outline: none;
}

.auth-input:focus {
    border-color: var(--tl-accent);
    box-shadow: 0 0 0 3px var(--tl-accent-soft);
}

.auth-input-code {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.5em;
    padding: 14px 16px;
}

.auth-error {
    color: var(--tl-coral);
    font-size: 13px;
    margin-top: 6px;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: var(--tl-radius-pill);
    background: var(--tl-accent);
    color: var(--tl-bg);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--tl-font);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn-debug {
    width: 100%;
    padding: 10px;
    border-radius: var(--tl-radius-pill);
    background: transparent;
    color: var(--tl-text-dim);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--tl-font);
    border: 1px dashed var(--tl-border-light);
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn-debug:hover {
    color: var(--tl-text-muted);
    border-color: var(--tl-text-dim);
}

.auth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(27, 29, 35, 0.3);
    border-top-color: var(--tl-bg);
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

@@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: var(--tl-radius-sm);
    font-size: 14px;
    line-height: 1.5;
}

.auth-message-success {
    background: var(--tl-green-soft);
    color: var(--tl-green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.auth-message-error {
    background: var(--tl-coral-soft);
    color: var(--tl-coral);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.auth-timer {
    margin-top: 24px;
    text-align: center;
}

.auth-timer span {
    font-size: 14px;
    color: var(--tl-text-muted);
}

.auth-progress {
    height: 4px;
    background: var(--tl-border);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.auth-progress-bar {
    height: 100%;
    background: var(--tl-green);
    border-radius: 2px;
    transition: width 1s linear;
}

.auth-footer {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--tl-border);
}

.auth-footer p {
    font-size: 13px;
    color: var(--tl-text-muted);
    margin: 0 0 6px;
    line-height: 1.5;
}

.auth-footer-dim {
    color: var(--tl-text-dim) !important;
    font-size: 12px !important;
}

.auth-footer a {
    color: var(--tl-accent);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-back-link {
    color: var(--tl-text-muted);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.auth-back-link:hover {
    color: var(--tl-text);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 36px 24px;
    }

    .auth-input-code {
        font-size: 22px;
        letter-spacing: 0.3em;
    }
}

/* ── Timelane UI Components (shared across views) ── */

/* Page layout */
.tl-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 0;
}

.tl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.tl-page-header h1 {
    font-size: 26px;
    font-weight: 300;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Buttons */
.tl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--tl-radius-pill);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--tl-font);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.tl-btn-accent {
    background: var(--tl-accent);
    color: var(--tl-bg);
}

.tl-btn-accent:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.tl-btn-ghost {
    background: transparent;
    border: 1px solid var(--tl-border-light);
    color: var(--tl-text-muted);
}

.tl-btn-ghost:hover {
    border-color: var(--tl-text-muted);
    color: var(--tl-text);
}

.tl-btn-danger {
    background: var(--tl-coral);
    color: #fff;
}

.tl-btn-danger:hover {
    filter: brightness(1.1);
}

/* Tables */
.tl-table-wrap {
    background: var(--tl-bg-raised);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius-md);
    overflow: hidden;
}

.tl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tl-table thead th {
    background: var(--tl-bg);
    color: var(--tl-text-dim);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 16px;
    border-bottom: 1px solid var(--tl-border);
    text-align: left;
}

.tl-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--tl-border);
    color: var(--tl-text);
    background: transparent !important;
}

.tl-table tbody tr:last-child td {
    border-bottom: none;
}

.tl-table tbody tr:hover td {
    background: var(--tl-bg-hover) !important;
}

.tl-td-muted {
    color: var(--tl-text-dim) !important;
}

.tl-td-empty {
    text-align: center;
    color: var(--tl-text-dim) !important;
    padding: 32px 16px !important;
}

.tl-tr-dim td {
    opacity: 0.6;
}

.tl-th-actions {
    width: 100px;
}

/* Badges */
.tl-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--tl-radius-pill);
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--tl-text-muted);
    border: 1px solid var(--tl-border);
}

.tl-badge-accent {
    background: var(--tl-accent-soft);
    color: var(--tl-accent);
    border-color: var(--tl-accent-border);
}

.tl-badge-dim {
    opacity: 0.5;
}

/* Icon buttons */
.tl-actions {
    display: flex;
    gap: 6px;
}

.tl-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--tl-border);
    background: transparent;
    color: var(--tl-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
}

.tl-icon-btn:hover {
    background: var(--tl-bg-hover);
    color: var(--tl-text);
    border-color: var(--tl-border-light);
}

.tl-icon-btn-danger:hover {
    background: var(--tl-coral-soft);
    color: var(--tl-coral);
    border-color: rgba(248, 113, 113, 0.3);
}

/* Modals */
.tl-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(27, 29, 35, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1050;
}

.tl-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    max-width: 92%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--tl-bg-raised);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius-lg);
    z-index: 1060;
    overflow: hidden;
}

/* EditForm inside modal must participate in flex layout */
.tl-modal > form,
.tl-modal > editform,
.tl-modal > [data-permanent] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.tl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--tl-border);
}

.tl-modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.tl-modal-close {
    background: none;
    border: none;
    color: var(--tl-text-dim);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
}

.tl-modal-close:hover {
    color: var(--tl-text);
}

.tl-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.tl-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--tl-border);
}

.tl-modal-lg {
    width: min(700px, 90vw);
}

/* Button group */
.tl-btn-group {
    display: flex;
    gap: 4px;
}

/* Form fields */
.tl-field {
    margin-bottom: 16px;
}

.tl-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tl-text-muted);
    margin-bottom: 6px;
}

.tl-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--tl-bg) !important;
    border: 1px solid var(--tl-border) !important;
    border-radius: var(--tl-radius-sm);
    color: var(--tl-text) !important;
    font-size: 14px;
    font-family: var(--tl-font);
    transition: border-color 0.2s;
    outline: none;
}

.tl-input:focus {
    border-color: var(--tl-accent) !important;
    box-shadow: 0 0 0 3px var(--tl-accent-soft) !important;
}

.tl-input:disabled {
    opacity: 0.5;
}

.tl-field-error {
    color: var(--tl-coral);
    font-size: 13px;
    margin-top: 4px;
}

.tl-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--tl-text-muted);
    cursor: pointer;
    margin-bottom: 8px;
}

/* Alerts */
.tl-alert {
    padding: 12px 16px;
    border-radius: var(--tl-radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    background: var(--tl-bg-raised);
    border: 1px solid var(--tl-border);
}

.tl-alert-error {
    background: var(--tl-coral-soft);
    color: var(--tl-coral);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Loading */
.tl-loading {
    display: flex;
    justify-content: center;
    padding: 60px;
}

.tl-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--tl-border);
    border-top-color: var(--tl-accent);
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

/* Empty state */
.tl-empty-state {
    text-align: center;
    padding: 80px 24px;
    max-width: 400px;
    margin: 0 auto;
}

.tl-empty-state h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.tl-empty-state p {
    color: var(--tl-text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Utility */
.tl-text-coral {
    color: var(--tl-coral);
}

/* ── Stats cards (Customers, Projects, Tasks) ── */
.cust-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.cust-stat {
    flex: 1;
    background: var(--tl-bg-raised);
    border: 1px solid var(--tl-border);
    border-radius: var(--tl-radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cust-stat-label {
    font-size: 12px;
    color: var(--tl-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.cust-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--tl-text);
}

.cust-stat-amount {
    font-size: 13px;
    color: var(--tl-text-muted);
}

@media (max-width: 767.98px) {
    .cust-stats {
        flex-direction: column;
        gap: 8px;
    }

    .cust-stat {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .cust-stat-value {
        font-size: 16px;
    }

    .cust-stat-amount {
        margin-left: auto;
    }
}