/**
 * Huqouk UI Refresh — تحسين شامل للتصميم مع الإبقاء على ألوان العلامة
 */

:root {
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-soft: 0 8px 30px rgba(15, 23, 42, 0.06);
    --shadow-elevated: 0 24px 60px rgba(15, 23, 42, 0.12);
    --transition-smooth: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Global polish ── */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.btn {
    border-radius: var(--radius-md);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), background var(--transition-smooth), color var(--transition-smooth), border-color var(--transition-smooth);
}

.btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.btn-large {
    border-radius: var(--radius-lg);
}

.white-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border-color: rgba(226, 232, 240, 0.95);
}

.white-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
}

.section {
    scroll-margin-top: calc(var(--navbar-height) + 12px);
}

.section-title {
    letter-spacing: -0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
    border-radius: var(--radius-md);
    background: #fff;
    border-color: #dbe4ee;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    background: #fff;
    box-shadow: 0 0 0 4px var(--ring);
}

/* ── Lawyers page ── */
.lawyers-page-body {
    padding-block: 16px 24px !important;
}

.lawyers-page-title {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 800;
    color: var(--primary-dark, #0f4c5c);
    margin: 0 0 12px;
    text-align: center;
}

.lawyers-page-disclaimer {
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--text-sec);
    text-align: center;
    line-height: 1.6;
}

.page[data-page="lawyers"] .lawyers-toolbar {
    margin-bottom: 8px;
}

.page[data-page="lawyers"] .lawyers-filter-sheet {
    margin-bottom: 12px;
}

.page[data-page="lawyers"] #lawyers-grid {
    gap: 16px;
}

.page[data-page="lawyers"] #lawyers-grid:empty {
    min-height: 0;
}

.page[data-page="lawyers"] #lawyers-grid:empty::after {
    content: "جاري تحميل المحامين…";
    display: block;
    text-align: center;
    color: var(--text-sec);
    padding: 16px;
    font-size: 14px;
}

/* ── صفحة التشخيص — مدمجة بدون فراغ ── */
.diagnosis-page-body {
    padding-block: 24px 32px !important;
}

.diagnosis-page-title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    margin-bottom: 8px;
}

.diagnosis-page-lead {
    max-width: 480px;
    margin: 0 auto 20px;
    font-size: 15px;
}

.page[data-page="case-diagnosis"] .cdw-page-section {
    padding-top: 0;
}

.page[data-page="case-diagnosis"] .hq-page-bottom {
    margin-top: 16px;
}

/* ── صفحة الاستشارة /case ── */
.case-page-hero {
    padding-bottom: clamp(28px, 4vw, 40px);
}

.case-page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.case-page-body {
    padding-block: 24px 36px !important;
}

.case-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.case-steps li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sec);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 8px;
}

.case-steps li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.12);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.case-form-card {
    padding: clamp(20px, 4vw, 32px) !important;
}

.case-field-hint {
    margin: 6px 0 0;
    line-height: 1.55;
}

.case-channel-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.case-channel-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    padding: 10px 12px;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-main);
}

.case-channel-option input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--primary, #1A5F7A);
    cursor: pointer;
}

.case-channel-option span {
    flex: 1;
    text-align: right;
}

.case-channel-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.08);
    box-shadow: 0 0 0 1px rgba(26, 95, 122, 0.12);
}

.case-channel-option:has(input:checked) span {
    color: var(--primary-dark, #0F172A);
    font-weight: 600;
}

/* تجاوز body.hq-v4 label { display:block } داخل خيارات التواصل */
body.hq-v4 .case-channel-option {
    display: flex !important;
    margin-bottom: 0;
}

/* أزرار الهيرو على الخلفية الداكنة — تباين واضح */
body.hq-v4 .case-page-hero .case-page-hero__actions .btn-primary-outline {
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    min-height: 38px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
}

body.hq-v4 .case-page-hero .case-page-hero__actions .btn-primary-outline:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
}

.case-file-upload {
    cursor: pointer;
    border-radius: 12px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.case-file-upload:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.04);
}

.case-files-preview {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    background: var(--bg-main);
}

.case-payment-summary {
    margin: 20px 0;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
}

.case-payment-summary h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--text-sec);
}

.case-fee-amount {
    margin: 0;
}

.case-submit-btn {
    width: 100%;
    min-height: 48px;
}

.case-success-card {
    margin-top: 16px;
    padding: 20px;
    border-radius: 14px;
    border: 1px dashed var(--primary);
    background: rgba(14, 165, 233, 0.05);
    text-align: center;
}

.case-success-card h3 {
    margin: 0 0 8px;
    color: var(--primary);
}

@media (max-width: 767px) {
    .case-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-page-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .case-page-hero__actions .btn.btn-sm {
        width: 100%;
        min-height: 40px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .case-channel-option {
        padding: 9px 11px;
        font-size: 13px;
    }
}

/* ── Navbar ── */
.navbar {
    border-bottom-color: rgba(226, 232, 240, 0.85);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.navbar.scrolled {
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.nav-item {
    position: relative;
    font-weight: 600;
    padding: 8px 4px;
}

.nav-item::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    bottom: 2px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition-smooth);
}

.nav-item:hover::after,
.nav-item.active::after {
    transform: scaleX(1);
}

.logo {
    transition: transform var(--transition-smooth);
}

.logo:hover {
    transform: translateY(-1px);
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.footer-nav-link {
    transition: color var(--transition-smooth);
}

.footer-nav-link:hover {
    color: var(--primary);
}

/* ── Cards & features ── */
.icon-badge {
    border-radius: var(--radius-md);
}

.transparent-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(6px);
}

.filter-btn {
    border-radius: 999px;
    transition: all var(--transition-smooth);
}

.lawyer-card {
    border-radius: var(--radius-lg);
}

/* ══════════════════════════════════════
   AUTH — صفحة الدخول والتسجيل (هادئة واحترافية)
   ══════════════════════════════════════ */

.auth-page {
    min-height: calc(100dvh - var(--navbar-height));
    padding: calc(var(--navbar-height) + 24px) 16px 40px;
}

.auth-shell {
    width: min(1040px, 100%);
}

.auth-panel--form {
    padding: clamp(22px, 3.5vw, 36px);
}

.auth-panel__eyebrow {
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 6px;
}

.auth-panel__title {
    font-size: clamp(1.3rem, 3vw, 1.55rem);
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.4;
    margin-bottom: 20px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    margin-bottom: 22px;
    border-radius: var(--radius-md);
    background: #eef2f7;
    border: 1px solid #e2e8f0;
}

.auth-tabs .auth-tab {
    border: none;
    background: transparent;
    color: var(--text-sec);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 12px;
    border-radius: 10px;
    box-shadow: none;
    cursor: pointer;
}

.auth-tabs .auth-tab.active {
    color: #fff;
    background: var(--primary);
}

.auth-forms-viewport {
    position: relative;
}

.page[data-page="login"] .auth-form {
    animation: none !important;
}

.page[data-page="login"] .auth-form:not(.active) {
    display: none !important;
}

.page[data-page="login"] .auth-form.active {
    display: block;
}

.auth-lead {
    color: var(--text-sec);
    line-height: 1.65;
    margin-bottom: 18px;
    font-size: 15px;
}

.auth-lawyer-cta {
    width: 100%;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1.5px dashed rgba(26, 95, 122, 0.35);
    background: rgba(26, 95, 122, 0.05);
    text-align: right;
    cursor: pointer;
}

.auth-lawyer-cta strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.auth-lawyer-cta small {
    color: var(--text-sec);
    line-height: 1.55;
}

.auth-lawyer-cta--panel {
    border-style: solid;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.12);
    color: #fff;
}

.auth-lawyer-cta--panel strong {
    color: #fff;
}

.auth-lawyer-cta--panel small {
    color: rgba(255, 255, 255, 0.85);
}

/* أقسام نموذج التسجيل */
.auth-register-block {
    padding: 16px 0;
    border-bottom: 1px solid #e8edf3;
    margin-bottom: 4px;
}

.auth-register-block:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.auth-register-block__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 14px;
}

.auth-register-block__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}

.auth-register-block--lawyer {
    padding-top: 8px;
}

.auth-note-inline {
    margin: -4px 0 12px;
}

#register-form .form-group input,
#register-form .form-group textarea,
#register-form .form-group select {
    min-height: 46px;
    border-radius: var(--radius-md);
}

.account-type-card {
    border-radius: var(--radius-md);
}

.account-type-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.auth-panel--visual h3 {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    line-height: 1.45;
}

@media (max-width: 900px) {
    .auth-shell.auth-premium-shell {
        grid-template-columns: 1fr;
    }

    .auth-panel--visual {
        order: -1;
        padding: 22px 18px;
    }

    .auth-panel--visual .auth-trust-list,
    .auth-lawyer-cta--panel {
        display: none;
    }

    .auth-panel--form {
        padding: 20px 16px 28px;
    }
}

@media (max-width: 768px) {
    .auth-page {
        padding: calc(var(--navbar-height) + 10px) 10px 24px;
        min-height: 100dvh;
    }
}

body:has(.page[data-page="login"].active-page) .footer {
    margin-top: 0;
}

.huqouk-boot-error {
    position: fixed;
    inset: 0;
    z-index: 13000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.huqouk-boot-error__panel {
    max-width: 420px;
    width: 100%;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: #fff;
    text-align: center;
    box-shadow: var(--shadow-elevated);
}

.huqouk-boot-error__panel strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.huqouk-boot-error__panel p {
    color: var(--text-sec);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ── Dashboard & app pages light touch ── */
.dashboard-sidebar {
    border-radius: var(--radius-lg);
}

.dash-action-tile {
    border-radius: var(--radius-md);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.dash-action-tile:hover {
    transform: translateY(-2px);
}

.modal-content {
    border-radius: var(--radius-lg);
}

/* ── Home & marketing sections ── */
.chat-hero {
    background:
        radial-gradient(900px 500px at 20% 20%, rgba(245, 158, 11, 0.12), transparent 55%),
        linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 52%, #1a6f8f 100%);
}

.hero-title {
    letter-spacing: -0.025em;
}

.stats-section {
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 300px at 80% 0%, rgba(245, 158, 11, 0.12), transparent 70%);
    pointer-events: none;
}

.stat-item {
    border-radius: var(--radius-md);
    transition: transform var(--transition-smooth);
}

.stat-item:hover {
    transform: translateY(-3px);
}

