/* ===== Sidebar Responsive Fix ===== */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed !important;
        top: 0; bottom: 0; right: 0;
        width: 82vw !important;
        max-width: 340px;
        min-width: 220px;
        height: 100vh !important;
        z-index: 1040;
        background: var(--primary);
        box-shadow: -2px 0 18px 0 rgba(44,62,80,0.13);
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(.4,1.3,.5,1);
        border-radius: 0 0 0 18px;
    }
    #sidebar.sidebar-open {
        transform: translateX(0);
    }
    body.sidebar-active::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(44,62,80,0.18);
        z-index: 1039;
        pointer-events: all;
    }
    .page-content {
        min-height: 100vh;
        overflow-x: hidden;
    }
}
/* تحسينات عامة للوحة تحكم المستخدم وصفحات اليوزر */
.user-dashboard-card, .restaurant-card-custom, .quick-actions-card, .stat-card {
    border-radius: 18px !important;
    box-shadow: 0 4px 24px 0 rgba(44,62,80,0.07) !important;
    border: none !important;
    background: #fff;
}
.user-dashboard-card .card-body, .restaurant-card-custom .card-body, .quick-actions-card .card-body, .stat-card .card-body {
    padding: 1.2rem 1.2rem !important;
}
.user-dashboard-card h2, .user-dashboard-card h4, .restaurant-card-custom h4, .restaurant-card-custom span.fw-bold {
    font-weight: 800 !important;
    letter-spacing: 0.5px;
}
.user-dashboard-card .btn, .quick-actions-card .btn, .restaurant-card-custom .btn {
    border-radius: 12px !important;
    font-weight: 700;
    transition: box-shadow 0.18s, background 0.18s;
}
.user-dashboard-card .btn:active, .quick-actions-card .btn:active, .restaurant-card-custom .btn:active {
    transform: scale(0.97);
}
.user-dashboard-card .badge, .restaurant-card-custom .badge {
    font-size: 1rem !important;
    font-weight: 500;
    border-radius: 10px !important;
}
.user-dashboard-card .stat-icon, .stat-card .stat-icon {
    width: 48px; height: 48px; font-size: 2rem; border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
@media (max-width: 767px) {
    .user-dashboard-card .card-body, .restaurant-card-custom .card-body, .quick-actions-card .card-body, .stat-card .card-body {
        padding: 0.7rem 0.5rem !important;
    }
    .user-dashboard-card h2, .user-dashboard-card h4, .restaurant-card-custom h4, .restaurant-card-custom span.fw-bold {
        font-size: 1.15rem !important;
    }
    .restaurant-logo-wrap img, .restaurant-logo-wrap .rounded-circle {
        width: 64px !important; height: 64px !important; font-size: 1.3rem !important;
    }
    .square-edit-btn {
        width: 38px !important; height: 38px !important; font-size: 1.1rem !important;
    }
    .stat-card .stat-icon, .user-dashboard-card .stat-icon {
        width: 36px !important; height: 36px !important; font-size: 1.2rem !important;
    }
    .quick-actions-card .btn, .restaurant-card-custom .btn {
        font-size: 0.97rem !important;
        padding: 0.45rem 0.7rem !important;
    }
}
/* Flex wrapper for auth pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
/* ===== Auth Pages (Login/Register) ===== */

.auth-bg {
    min-height: 100vh;
    width: 100vw;
    background: linear-gradient(120deg, rgba(44,62,80,0.55) 0%, rgba(230,126,34,0.18) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0;
}

.auth-bg + .auth-card, .auth-card {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    /* ...existing code... */
}
body {
    overflow-x: hidden;
}

.auth-card {
    border-radius: 22px;
    box-shadow: 0 8px 32px 0 rgba(44,62,80,0.18), 0 2px 8px 0 rgba(230,126,34,0.10);
    border: 1.5px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    padding: 2.7rem 2rem 2.2rem 2rem;
    max-width: 410px;
    width: 100%;
    margin: 3.5rem auto 3.5rem auto;
    transition: box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}
.auth-card .auth-icon {
    font-size: 3.2rem;
    color: var(--primary);
    margin-bottom: 0.7rem;
    filter: drop-shadow(0 2px 8px rgba(230,126,34,0.13));
}
.auth-card h4 {
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}
.auth-card .form-label {
    font-weight: 600;
    letter-spacing: 0.1px;
}
.auth-card .form-control {
    background: rgba(255,255,255,0.93);
    border-radius: 10px;
    border: 1.2px solid #e8edf3;
    font-size: 1.08rem;
    min-height: 44px;
    transition: border-color 0.2s;
}
.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.18rem rgba(230,126,34,0.13);
}
.auth-card .btn-primary {
    font-size: 1.13rem;
    padding: 0.8rem 0;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(230,126,34,0.10);
}
.auth-card .input-group-text {
    background: #f7f7fa;
    border: 1px solid #e8edf3;
    border-radius: 10px 0 0 10px;
}
.auth-card .alert {
    border-radius: 10px;
    font-size: 0.98rem;
}
.auth-card .text-primary {
    color: var(--primary) !important;
}
@media (max-width: 480px) {
    .auth-card {
        padding: 1.2rem 0.7rem;
        max-width: 98vw;
    }
}
.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.18rem rgba(230,126,34,0.13);
}
.auth-card .btn-primary {
    font-size: 1.1rem;
    padding: 0.75rem 0;
    border-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.auth-card .input-group-text {
    background: #f7f7fa;
    border: 1px solid #e8edf3;
}
.auth-card .form-label {
    font-weight: 600;
}
.auth-card .alert {
    border-radius: 10px;
    font-size: 0.98rem;
}
.auth-card .display-4, .auth-card .bi {
    color: var(--primary);
}
.auth-card .text-primary {
    color: var(--primary) !important;
}

/* Password toggle inside the field */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-strong-password-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

.password-toggle-wrapper input.form-control {
    padding-left: 3.25rem !important;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
    color: var(--primary) !important;
    outline: none;
    box-shadow: none;
}

.password-toggle-btn i {
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 767.98px) {
    .password-toggle-wrapper input.form-control {
        padding-left: 3rem !important;
    }
}
/* ===== Design Tokens ===== */
:root {
    --primary: #e67e22;
    --secondary: #2c3e50;
    --surface: #ffffff;
    --surface-soft: #f5f7fb;
    --text-main: #273240;
    --text-muted: #6c7a89;
    --border-soft: #e8edf3;
    --shadow-sm: 0 6px 18px rgba(28, 37, 46, 0.08);
    --shadow-md: 0 14px 34px rgba(28, 37, 46, 0.14);
    --radius-lg: 18px;
    --radius-md: 12px;
    --ease: all 0.25s ease;
}

/* ===== Global ===== */
body {
    font-family: 'Tajawal', "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 8% 5%, rgba(230, 126, 34, 0.09), transparent 30%),
        radial-gradient(circle at 90% 12%, rgba(44, 62, 80, 0.08), transparent 30%),
        var(--surface-soft);
    color: var(--text-main);
    text-rendering: optimizeLegibility;
}

input,
textarea,
select,
button,
.form-control,
.form-select,
.input-group-text,
.btn,
.dropdown-menu,
.tooltip,
.popover,
input::placeholder,
textarea::placeholder {
    font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #1f2935;
    font-weight: 700;
}

.text-muted {
    color: var(--text-muted) !important;
}

.card,
.alert,
.form-control,
.form-select,
.input-group-text,
.btn {
    border-radius: var(--radius-md);
}

.card {
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.btn {
    transition: var(--ease);
}

.btn-primary {
    border-color: var(--primary);
    background-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: #d96f12;
    background-color: #d96f12;
    box-shadow: 0 10px 18px rgba(230, 126, 34, 0.24);
}

.btn-outline-primary {
    border-color: #d9dee5;
    color: #2f3b48;
}

.btn-outline-primary:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.form-control,
.form-select,
.input-group-text {
    border: 1px solid #dce3eb;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(230, 126, 34, 0.6);
    box-shadow: 0 0 0 0.22rem rgba(230, 126, 34, 0.13);
}

/* ===== Navbar ===== */
.main-navbar {
    background: linear-gradient(120deg, var(--secondary), #1f2d3b) !important;
    padding: 0.7rem 0;
    /* لا نضيف transition للـ navbar لتجنب المشاكل */
    contain: layout style paint;
    will-change: auto;
}

.navbar-brand {
    letter-spacing: -0.2px;
}

.main-navbar .nav-link {
    color: rgba(255, 255, 255, 0.88);
    border-radius: 10px;
    padding: 0.45rem 0.78rem;
    /* لا نستخدم var(--ease) للـ nav-link في الـ navbar */
    transition: color 0.25s ease, background 0.25s ease;
}

.main-navbar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.btn-nav-cta {
    font-weight: 700;
    border: 0;
}

/* ===== Landing ===== */
.hero-section {
    padding: 4.2rem 2rem;
    background:
        linear-gradient(140deg, rgba(230, 126, 34, 0.94), rgba(44, 62, 80, 0.95)),
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.24), transparent 40%);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-section .lead {
    max-width: 760px;
    margin-inline: auto;
}

.landing-section {
    position: relative;
}

.section-soft {
    background: linear-gradient(180deg, #ffffff, #f9fbff);
    border: 1px solid var(--border-soft);
}

.pricing-section .card {
    transition: var(--ease);
}

.pricing-section .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.cta-section {
    background: linear-gradient(120deg, var(--secondary), #253647);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow-md);
}

/* ===== Step circles ===== */
.step-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--primary), #d96f12);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 18px rgba(230, 126, 34, 0.25);
}

/* ===== Cards & Hover ===== */
.hover-card {
    transition: var(--ease);
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
}

/* ===== Ads ===== */
.ad-banner {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ad-banner img {
    border-radius: var(--radius-md);
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(120deg, #17212c, #222f3d);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .main-navbar .nav-link {
        margin-bottom: 0.25rem;
    }

    .btn-nav-cta {
        display: inline-block;
        margin-top: 0.3rem;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 3.2rem 1.2rem;
    }

    .section-soft {
        padding: 1.8rem 1rem !important;
    }
}
