/* ============================================================
   assets/css/app.css  –  HealthDB.net
   Bootstrap 5.3 overrides + Tailwind-inspired utilities
   Font: Inter (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    --bs-primary:          #2563eb;
    --bs-primary-rgb:      37, 99, 235;
    --bs-secondary:        #64748b;
    --bs-success:          #16a34a;
    --bs-danger:           #dc2626;
    --bs-warning:          #d97706;
    --bs-info:             #0891b2;
    --bs-light:            #f8fafc;
    --bs-dark:             #1e293b;
    --bs-body-bg:          #f1f5f9;
    --bs-body-color:       #334155;
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bs-body-font-size:   0.9375rem;
    --bs-body-line-height: 1.6;
    --bs-border-color:     #e2e8f0;
    --bs-border-radius:    0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.75rem;
    --bs-border-radius-xl: 1rem;
    --bs-box-shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --bs-box-shadow-sm:    0 1px 2px rgba(0,0,0,.05);
    --bs-box-shadow-lg:    0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
    --top-navbar-height:   60px;
    --transition-fast:     all .15s ease;
    --transition-base:     all .2s ease;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--bs-body-font-family);
    background:  var(--bs-body-bg);
    color:       var(--bs-body-color);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.fw-300 { font-weight: 300 !important; }
.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-500 { color: #64748b !important; }
.text-slate-600 { color: #475569 !important; }
.text-slate-700 { color: #334155 !important; }
.text-slate-800 { color: #1e293b !important; }
.text-slate-900 { color: #0f172a !important; }
.text-blue-600  { color: #2563eb !important; }

.bg-slate-50  { background-color: #f8fafc !important; }
.bg-slate-100 { background-color: #f1f5f9 !important; }
.bg-slate-200 { background-color: #e2e8f0 !important; }
.bg-blue-50   { background-color: #eff6ff !important; }
.bg-blue-600  { background-color: #2563eb !important; }

/* ============================================================
   SHADOWS
   ============================================================ */
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.05) !important; }
.shadow    { box-shadow: var(--bs-box-shadow) !important; }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05) !important; }
.shadow-lg { box-shadow: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06) !important; }
.shadow-xl { box-shadow: 0 20px 40px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.08) !important; }

/* ============================================================
   BORDER RADIUS
   ============================================================ */
.rounded-xl  { border-radius: 0.75rem !important; }
.rounded-2xl { border-radius: 1rem !important; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border:        none;
    border-radius: 0.75rem;
    box-shadow:    var(--bs-box-shadow);
    background:    #ffffff;
    transition:    var(--transition-base);
}

.card-header {
    background:    #ffffff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding:       1rem 1.25rem;
    font-weight:   600;
    color:         #334155;
}

/* Trial result card */
.trial-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.trial-card:hover {
    transform:  translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1) !important;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.top-navbar {
    height:        var(--top-navbar-height);
    background:    #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position:      sticky;
    top:           0;
    z-index:       100;
    padding:       0 1.5rem;
    display:       flex;
    align-items:   center;
}

.top-navbar .nav-link {
    color:       #64748b;
    font-weight: 500;
    font-size:   .9rem;
    padding:     .4rem .75rem;
    border-radius: .5rem;
    transition:  var(--transition-fast);
}
.top-navbar .nav-link:hover {
    background: #f1f5f9;
    color:      #1e293b;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: 0.5rem;
    font-weight:   500;
    transition:    var(--transition-fast);
}

.btn-primary {
    background:   #2563eb;
    border-color: #2563eb;
    color:        #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background:   #1d4ed8;
    border-color: #1d4ed8;
    color:        #fff;
}

.btn-outline-primary {
    color:        #2563eb;
    border-color: #2563eb;
}
.btn-outline-primary:hover {
    background:   #2563eb;
    border-color: #2563eb;
    color:        #fff;
}

.btn-light {
    background:   #f1f5f9;
    border-color: #e2e8f0;
    color:        #475569;
}
.btn-light:hover {
    background:   #e2e8f0;
    color:        #334155;
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color:  #e2e8f0;
    color:         #334155;
    font-size:     0.9rem;
    padding:       0.5rem 0.75rem;
    transition:    var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: #2563eb;
    box-shadow:   0 0 0 3px rgba(37,99,235,.12);
    color:        #1e293b;
}

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

.input-group-text {
    border-color:  #e2e8f0;
    background:    #f8fafc;
    color:         #94a3b8;
}

/* ============================================================
   FILTERS SIDEBAR
   ============================================================ */
.filters-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.filters-sidebar::-webkit-scrollbar { width: 4px; }
.filters-sidebar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.sidebar-filter-label {
    font-size:      .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight:    700;
    color:          #94a3b8;
}

/* Filter checkbox items */
.filter-check-item {
    border-radius: .5rem;
    padding:       .35rem .5rem;
    cursor:        pointer;
    transition:    var(--transition-fast);
}
.filter-check-item:hover { background: #f1f5f9; }
.filter-check-item.active { background: #eff6ff; }
.filter-check-item input[type="checkbox"],
.filter-check-item input[type="radio"] {
    cursor: pointer;
    accent-color: #2563eb;
}
.cursor-pointer { cursor: pointer; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-weight:    600;
    border-radius:  0.375rem;
    font-size:      0.72rem;
    letter-spacing: .02em;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border: none; border-radius: 0.625rem; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info    { background: #f0f9ff; color: #0c4a6e; }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown-menu {
    border:        none;
    border-radius: 0.625rem;
    box-shadow:    0 8px 24px rgba(0,0,0,.12);
    padding:       0.375rem;
    font-size:     0.875rem;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding:       0.4rem 0.75rem;
    transition:    var(--transition-fast);
}
.dropdown-item:hover  { background: #f1f5f9; }
.dropdown-item.active { background: #2563eb !important; }

/* ============================================================
   PAGINATION
   ============================================================ */
.page-link {
    border-radius: .5rem;
    color:         #2563eb;
    transition:    var(--transition-fast);
}
.page-link:hover {
    background: #eff6ff;
    color:      #1d4ed8;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   MIN WIDTH FIX
   ============================================================ */
.min-width-0 { min-width: 0; }

/* ============================================================
   HERO PAGE
   ============================================================ */
.page-home .hero-section {
    padding-top: 3rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .top-navbar { padding: 0 1rem; }
}

@media (max-width: 575.98px) {
    .card { border-radius: .5rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .top-navbar, .filters-sidebar, .btn { display: none !important; }
}

/* ============================================================
   HOME PAGE — добави в края на app.css
   ============================================================ */

/* Prevent horizontal overflow */
.page-home { overflow-x: hidden; }

/* Footer */
.hdb-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 4rem 0 2rem;
}
.border-footer { border-color: #1e293b !important; }
.hdb-footer-logo-mark {
    width: 30px; height: 30px;
    background: #fff; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #0f172a;
}
.hdb-footer-logo-name {
    font-size: .9375rem; font-weight: 800;
    letter-spacing: -.03em; color: #fff;
}
.text-blue-400 { color: #60a5fa; }
.text-footer-muted { color: #64748b; }
.hdb-footer-col-label {
    font-size: .72rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: #475569;
}
.hdb-footer-link {
    font-size: .845rem; color: #64748b;
    text-decoration: none; transition: color 130ms ease;
}
.hdb-footer-link:hover { color: #e2e8f0; }
.hdb-footer-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #22c55e; flex-shrink: 0;
    animation: live-pulse 2.5s ease infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
    50%       { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* ============================================================
   SEARCH AUTOCOMPLETE SUGGESTIONS
   ============================================================ */
.suggest-wrap { position: relative; flex: 1; min-width: 0; }

.suggest-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .625rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 500;
    overflow: hidden;
    display: none;
}
.suggest-dropdown.visible { display: block; }

.suggest-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .6rem .875rem;
    font-size: .875rem;
    color: #334155;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background 100ms;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active { background: #f0f9ff; color: #1d4ed8; }
.suggest-item-icon { color: #94a3b8; font-size: .8rem; flex-shrink: 0; }
.suggest-item em {
    font-style: normal;
    font-weight: 700;
    color: #0f172a;
}
.suggest-item:hover em, .suggest-item.active em { color: #1d4ed8; }

/* ============================================================
   PREFERENCES MODAL
   ============================================================ */

/* Trigger button in navbar */
.nav-prefs-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .625rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .4rem;
    background: #fff;
    color: #475569;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .13s, background .13s, color .13s;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-prefs-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #0f172a;
}
.nav-prefs-btn .prefs-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.nav-prefs-btn .prefs-flag-placeholder {
    width: 18px;
    height: 13px;
    background: #e2e8f0;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Modal overrides */
.prefs-modal .modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 24px 64px rgba(0,0,0,.14);
}
.prefs-modal .modal-header {
    padding: 1.25rem 1.5rem .875rem;
    border-bottom: 1px solid #f1f5f9;
}
.prefs-modal .modal-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #0f172a;
}
.prefs-modal .modal-body {
    padding: 1.25rem 1.5rem;
}
.prefs-modal .modal-footer {
    padding: .875rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Section label inside modal */
.prefs-section-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: .625rem;
    display: block;
}

/* Language tab pills */
.prefs-lang-group {
    display: flex;
    gap: .375rem;
}
.prefs-lang-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .5rem;
    background: #fff;
    color: #475569;
    font-size: .845rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .13s, background .13s, color .13s;
}
.prefs-lang-btn img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}
.prefs-lang-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #0f172a;
}
.prefs-lang-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Country search */
.prefs-country-search {
    width: 100%;
    padding: .5rem .75rem .5rem 2.25rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .5rem;
    font-size: .875rem;
    color: #334155;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
    background: #fff;
}
.prefs-country-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.prefs-country-search-wrap {
    position: relative;
    margin-bottom: .625rem;
}
.prefs-country-search-wrap .prefs-search-icon {
    position: absolute;
    left: .625rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: .875rem;
    pointer-events: none;
}

/* Country list */
.prefs-country-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.prefs-country-list::-webkit-scrollbar { width: 4px; }
.prefs-country-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.prefs-country-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem .75rem;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid #f8fafc;
}
.prefs-country-item:last-child { border-bottom: none; }
.prefs-country-item:hover { background: #f8fafc; }
.prefs-country-item.selected {
    background: #eff6ff;
}
.prefs-country-item img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.prefs-country-item .prefs-country-name {
    flex: 1;
    font-size: .875rem;
    color: #334155;
    font-weight: 500;
}
.prefs-country-item .prefs-country-iso {
    font-size: .72rem;
    color: #94a3b8;
    font-family: monospace;
}
.prefs-country-item .prefs-check {
    color: #2563eb;
    font-size: .875rem;
    flex-shrink: 0;
    opacity: 0;
}
.prefs-country-item.selected .prefs-check { opacity: 1; }

/* Currency pills */
.prefs-currency-group {
    display: flex;
    gap: .375rem;
}
.prefs-currency-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .5rem .75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .5rem;
    background: #fff;
    color: #475569;
    font-size: .845rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .13s, background .13s, color .13s;
}
.prefs-currency-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #0f172a;
}
.prefs-currency-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}
.prefs-currency-symbol {
    font-size: 1rem;
    font-weight: 700;
}

/* Save button */
.prefs-save-btn {
    width: 100%;
    padding: .625rem;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: .5rem;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.prefs-save-btn:hover  { background: #1e293b; }
.prefs-save-btn:active { transform: scale(.98); }

/* Loading skeleton inside country list */
.prefs-skeleton {
    height: 40px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e8ecf0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: prefs-shimmer 1.4s infinite;
    border-radius: .375rem;
    margin: .25rem .5rem;
}
@keyframes prefs-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-page {
    min-height: calc(100dvh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: #f8fafc;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 32px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
    padding: 2.25rem 2rem;
}
.auth-card--success,
.auth-card--error {
    text-align: center;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.auth-title {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: #0f172a;
    margin-bottom: .375rem;
    text-align: center;
}
.auth-subtitle {
    font-size: .875rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1;
}

/* Fields */
.auth-field {
    margin-bottom: 1.125rem;
}
.auth-label {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: .03em;
    margin-bottom: .375rem;
}
.auth-input {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .5rem;
    font-size: .9rem;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
    font-family: inherit;
    appearance: none;
}
.auth-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.has-error .auth-input,
.auth-input.is-invalid {
    border-color: #dc2626;
}
.has-error .auth-input:focus {
    box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.auth-error {
    display: block;
    font-size: .78rem;
    color: #dc2626;
    margin-top: .3rem;
}

/* Password show/hide */
.auth-input-pw {
    position: relative;
}
.auth-input-pw .auth-input {
    padding-right: 2.5rem;
}
.auth-pw-toggle {
    position: absolute;
    right: .625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: .25rem;
    line-height: 1;
    transition: color .13s;
}
.auth-pw-toggle:hover { color: #475569; }

/* Alert */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .75rem 1rem;
    border-radius: .5rem;
    font-size: .875rem;
    margin-bottom: 1.25rem;
}
.auth-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.auth-alert--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Button */
.auth-btn {
    width: 100%;
    padding: .75rem;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: .5rem;
    font-size: .9375rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-decoration: none;
    transition: background .14s, transform .1s;
    margin-top: 1.375rem;
    font-family: inherit;
}
.auth-btn:hover  { background: #1e293b; color: #fff; }
.auth-btn:active { transform: scale(.98); }

/* Footer links */
.auth-footer-links {
    text-align: center;
    font-size: .845rem;
    color: #64748b;
    margin-top: 1.25rem;
}
.auth-footer-links a,
.auth-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.auth-footer-links a:hover,
.auth-link:hover { text-decoration: underline; }

/* Profile avatar */
.auth-avatar-big {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: 1.375rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Gender radio buttons */
.auth-gender-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .5rem;
    cursor: pointer;
    font-size: .845rem;
    font-weight: 600;
    color: #475569;
    transition: border-color .13s, background .13s, color .13s;
}
.auth-gender-btn input[type="radio"] { display: none; }
.auth-gender-btn:has(input:checked),
.auth-gender-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}
.auth-gender-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card { padding: 1.75rem 1.25rem; border-radius: .75rem; }
}

/* Auth divider & Google button */
.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: #94a3b8;
    font-size: .78rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    padding: .65rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .5rem;
    background: #fff;
    color: #334155;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .13s, background .13s, box-shadow .13s;
    font-family: inherit;
}
.auth-google-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ============================================================
   TRIAL DETAIL PAGE  — добави в края на assets/css/app.css
   ============================================================ */


/* ---- Page layout ---- */
.trial-page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}
 
/* ---- Back link ---- */
.trial-back-link {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .845rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 150ms ease-out, gap 150ms ease-out;
}
.trial-back-link:hover {
    color: #2563eb;
    gap: .5rem;
}
 
/* ---- Cards ---- */
.trial-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .875rem;
    margin-bottom: 1rem;
    overflow: hidden;
}
.trial-card-body {
    padding: 1.5rem;
}
.trial-card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #f1f5f9;
}
.trial-card-header svg {
    flex-shrink: 0;
}
 
/* ---- Status / Phase badges ---- */
.trial-status-badge {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .3em .8em;
    letter-spacing: .01em;
}
.trial-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.trial-phase-badge {
    display: inline-flex;
    font-size: .78rem;
    font-weight: 600;
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: .3em .8em;
}
.trial-id-badge {
    display: inline-flex;
    font-size: .75rem;
    font-weight: 500;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .375rem;
    padding: .25em .65em;
    font-family: 'Courier New', monospace;
}
 
/* ---- Title ---- */
.trial-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.4;
    color: #0f172a;
    margin: .875rem 0 .75rem;
}
 
/* ---- Phase info box ---- */
.trial-phase-info {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #f0f9ff;
    border-left: 3px solid #0891b2;
    border-radius: 0 .5rem .5rem 0;
    margin-bottom: .875rem;
    font-size: .875rem;
    color: #0c4a6e;
    line-height: 1.55;
}
 
/* ---- Condition tags ---- */
.trial-cond-tag {
    display: inline-flex;
    font-size: .78rem;
    font-weight: 500;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .375rem;
    padding: .25em .65em;
    text-decoration: none;
    transition: background 130ms ease-out, border-color 130ms ease-out, color 130ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
    .trial-cond-tag:hover {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }
}
 
/* ---- Section text ---- */
.trial-section-text {
    font-size: .9rem;
    color: #475569;
    line-height: 1.75;
    white-space: pre-line;
}
 
/* ---- Show more button ---- */
.trial-show-more {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .845rem;
    font-weight: 600;
    color: #2563eb;
    background: none;
    border: none;
    padding: .5rem 0 0;
    cursor: pointer;
    font-family: inherit;
    transition: gap 150ms ease-out;
}
.trial-show-more:hover { gap: .45rem; }
 
/* ---- Locations ---- */
.trial-country-group {
    margin-bottom: 1rem;
}
.trial-country-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: .5rem;
}
.trial-country-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.trial-location-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: .5rem;
    margin-bottom: .375rem;
    font-size: .845rem;
    animation: trial-fade-in 280ms var(--ease-out) both;
}
.trial-location-item + .trial-location-item { margin-top: .25rem; }
.trial-location-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
    margin-top: .3rem;
}
.trial-location-name { font-weight: 600; color: #334155; }
.trial-location-city { color: #94a3b8; font-size: .8rem; margin-top: .1rem; }
.trial-location-contact { margin-top: .375rem; }
.trial-location-contact a {
    color: #2563eb;
    text-decoration: none;
    font-size: .8rem;
}
.trial-location-contact a:hover { text-decoration: underline; }
 
/* ---- Intervention pills ---- */
.trial-intervention {
    display: flex;
    flex-direction: column;
    padding: .625rem .75rem;
    background: #f8fafc;
    border-radius: .5rem;
    margin-bottom: .375rem;
    border-left: 3px solid #e2e8f0;
}
.trial-intervention-name {
    font-size: .845rem;
    font-weight: 600;
    color: #334155;
}
.trial-intervention-type {
    font-size: .75rem;
    color: #94a3b8;
    margin-top: .125rem;
}
 
/* ============================================================
   SIDEBAR (RIGHT)
   ============================================================ */
 
.trial-sidebar-sticky {
    position: sticky;
    top: 76px; /* 60px navbar + 16px breathing room */
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.trial-sidebar-sticky::-webkit-scrollbar { width: 3px; }
.trial-sidebar-sticky::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
 
/* Sidebar header */
.trial-sidebar-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .875rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #f1f5f9;
    letter-spacing: -.01em;
}
 
/* Fact rows */
.trial-fact-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid #f8fafc;
}
.trial-fact-row:last-child { border-bottom: none; }
.trial-fact-label {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .78rem;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}
.trial-fact-icon {
    font-size: .7rem;
    color: #cbd5e1;
}
.trial-fact-value {
    font-size: .845rem;
    font-weight: 600;
    color: #334155;
    text-align: right;
    word-break: break-word;
    margin-bottom: 0;
}
 
/* ---- Inquiry CTA button ---- */
.trial-inquiry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1rem;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: .625rem;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 150ms ease-out, transform 100ms ease-out;
    letter-spacing: -.01em;
}
@media (hover: hover) and (pointer: fine) {
    .trial-inquiry-btn:hover {
        background: #1e293b;
        color: #fff;
    }
}
.trial-inquiry-btn:active {
    transform: scale(.98);
    color: #fff;
}
 
/* Secondary registry link */
.trial-registry-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    width: 100%;
    padding: .4rem;
    font-size: .775rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: .375rem;
    transition: color 130ms ease-out, background 130ms ease-out;
}
.trial-registry-link:hover {
    color: #475569;
    background: #f8fafc;
}
 
/* ---- Disclaimer ---- */
.trial-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: .375rem;
    font-size: .73rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid #f8fafc;
}
.trial-disclaimer svg { flex-shrink: 0; margin-top: .05rem; }
 
/* ---- Entry animation ---- */
@keyframes trial-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
 
/* Stagger for main sections */
.trial-card:nth-child(1) { animation: trial-fade-in 320ms var(--ease-out) 0ms both; }
.trial-card:nth-child(2) { animation: trial-fade-in 320ms var(--ease-out) 50ms both; }
.trial-card:nth-child(3) { animation: trial-fade-in 320ms var(--ease-out) 100ms both; }
.trial-card:nth-child(4) { animation: trial-fade-in 320ms var(--ease-out) 150ms both; }
.trial-card:nth-child(5) { animation: trial-fade-in 320ms var(--ease-out) 200ms both; }
 
/* ---- Responsive ---- */
@media (max-width: 991px) {
    .trial-sidebar-sticky {
        position: static;
        max-height: none;
    }
    .trial-title { font-size: 1.125rem; }
    .trial-page-container { padding: 1.25rem 1rem 3rem; }
}
 
@media (prefers-reduced-motion: reduce) {
    .trial-card,
    .trial-location-item,
    .trial-back-link,
    .trial-cond-tag,
    .trial-show-more {
        animation: none;
        transition: none;
    }
}
 
/* ---- Translate button (FAB) ---- */
.trial-translate-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.125rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(37,99,235,.35);
    transition: background 150ms ease-out, transform 100ms ease-out, box-shadow 150ms ease-out;
}
.trial-translate-btn:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37,99,235,.45);
}
.trial-translate-btn:active { transform: scale(.97); }
.trial-translate-btn:disabled { opacity: .75; cursor: wait; }
.trial-translate-btn .translate-btn-loader {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}
@keyframes translate-spin {
    to { transform: rotate(360deg); }
}
.translate-spin {
    animation: translate-spin .8s linear infinite;
}
 
/* ---- Language pills ---- */
.trial-lang-pills {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.trial-lang-label {
    font-size: .75rem;
    color: #94a3b8;
    font-weight: 500;
    margin-right: .125rem;
}
.trial-lang-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25em .65em;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    font-size: .75rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: border-color 130ms ease-out, background 130ms ease-out, color 130ms ease-out;
    font-family: inherit;
    letter-spacing: .02em;
}
.trial-lang-pill:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #1d4ed8;
}
.trial-lang-pill.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}
.trial-lang-pill-pending {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25em .65em;
    border: 1.5px dashed #e2e8f0;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    color: #cbd5e1;
    cursor: default;
    letter-spacing: .02em;
}
 
/* ---- Formatted trial text ---- */
.trial-section-text {
    font-size: .9rem;
    color: #475569;
    line-height: 1.75;
}
.trial-section-text strong,
.trial-section-text .trial-section-title {
    display: block;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1rem;
    margin-bottom: .25rem;
    font-size: .875rem;
}
.trial-section-text .trial-list-num {
    font-weight: 600;
    color: #2563eb;
    font-size: .85rem;
}
.trial-section-text .trial-list-bullet {
    color: #2563eb;
    font-size: .9rem;
}

/* ============================================================
   TRIAL PAGE ADDITIONS — добави в app.css
   ============================================================ */

/* ---- Facts sidebar — grouped ---- */
.trial-facts { display: flex; flex-direction: column; gap: 0; }

.trial-fact-group {
    padding: .5rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.trial-fact-group:last-child { border-bottom: none; padding-bottom: 0; }
.trial-fact-group:first-child { padding-top: 0; }

.trial-fact-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    padding: .3rem 0;
}
.trial-fact-label {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .775rem;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}
.trial-fact-icon-svg {
    display: inline-flex;
    align-items: center;
    color: #cbd5e1;
    flex-shrink: 0;
}
.trial-fact-value {
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
    text-align: right;
    word-break: break-word;
    margin: 0;
}

/* ---- Interventions grid ---- */
.trial-ivs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .5rem;
}
.trial-intervention {
    padding: .625rem .75rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-left: 3px solid #bfdbfe;
    border-radius: .5rem;
}
.trial-intervention-name {
    font-size: .845rem;
    font-weight: 600;
    color: #1e40af;
    line-height: 1.4;
}
.trial-intervention-type {
    font-size: .75rem;
    color: #94a3b8;
    margin-top: .2rem;
}
.trial-intervention-original {
    font-size: .72rem;
    color: #cbd5e1;
    margin-top: .2rem;
    font-style: italic;
}

/* ---- Nav preferences button update ---- */
/* Замени съществуващите .nav-prefs-btn стилове в app.css */

.nav-prefs-btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .3rem .5rem .3rem .5rem;
    border: 1px solid #e2e8f0;
    border-radius: .4rem;
    background: #fff;
    color: #334155;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .13s, background .13s, color .13s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}
.nav-prefs-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #0f172a;
}
.nav-prefs-inner {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.nav-prefs-btn .prefs-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.nav-prefs-chevron {
    color: #94a3b8;
    flex-shrink: 0;
    transition: color .13s;
}
.nav-prefs-btn:hover .nav-prefs-chevron { color: #475569; }

/* ============================================================
   NAV BUTTONS REDESIGN — замени/добави в app.css
   (замества старите .nav-prefs-btn, .nav-cta стилове)
   ============================================================ */

/* ---- Globe / Preferences button ---- */
.nav-prefs-btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .35rem .625rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .45rem;
    background: #fff;
    color: #475569;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .13s, background .13s, color .13s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
    text-decoration: none;
}
.nav-prefs-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #1d4ed8;
}
.nav-prefs-label-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-prefs-chevron {
    color: #94a3b8;
    flex-shrink: 0;
}
.nav-prefs-btn:hover .nav-prefs-chevron { color: #64748b; }

/* ---- Login button ---- */
.nav-login-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .75rem;
    border: 1.5px solid transparent;
    border-radius: .45rem;
    background: transparent;
    color: #475569;
    font-size: .845rem;
    font-weight: 600;
    text-decoration: none;
    transition: color .13s, background .13s;
    white-space: nowrap;
}
.nav-login-btn:hover {
    color: #0f172a;
    background: #f8fafc;
}

/* ---- Register button — outlined dark ---- */
.nav-register-btn {
    display: inline-flex;
    align-items: center;
    padding: .35rem .875rem;
    border: 1.5px solid #0f172a;
    border-radius: .45rem;
    background: #fff;
    color: #0f172a;
    font-size: .845rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .13s, color .13s;
    white-space: nowrap;
}
.nav-register-btn:hover {
    background: #0f172a;
    color: #fff;
}

/* ---- Search CTA — filled blue ---- */
.nav-search-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: .45rem;
    font-size: .845rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .14s, transform .1s;
    white-space: nowrap;
}
.nav-search-cta:hover  { background: #1d4ed8; color: #fff; }
.nav-search-cta:active { transform: scale(.97); }
.nav-search-cta svg    { flex-shrink: 0; }

/* ---- Logged-in user button ---- */
.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .625rem .3rem .3rem;
    border: 1.5px solid #e2e8f0;
    border-radius: .45rem;
    background: #fff;
    color: #334155;
    font-size: .845rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .13s, background .13s;
    white-space: nowrap;
}
.nav-user-btn:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    color: #0f172a;
}
.nav-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}