/* ============================================================
   modern.css — lightweight modern skin for public/auth pages
   Scoped under .auth-page so it never touches the admin panel.
   Works for both RTL (ar) and LTR via logical properties.
   ============================================================ */

:root {
    /* Brand palette — matches the app's existing primary blue (#20599b) */
    --mp-primary: #20599b;
    --mp-primary-600: #1c4f8a;
    --mp-primary-700: #17406e;
    --mp-accent: #2f74c0;
    --mp-ink: #191c24;
    --mp-muted: #64748b;
    --mp-radius: 18px;
    --mp-shadow: 0 22px 50px -18px rgba(32, 89, 155, .40);
}

/* ---------- Page background ---------- */
.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--mp-ink);
    font-family: 'Noto Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #eef3f9 0%, #f3f6f9 45%, #e8eff7 100%);
    position: relative;
    overflow-x: hidden;
}

/* soft decorative gradient blobs */
.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    z-index: 0;
    pointer-events: none;
}

.auth-page::before {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #bcd4ef, transparent 70%);
    top: -130px;
    inset-inline-start: -120px;
}

.auth-page::after {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #cfe0f2, transparent 70%);
    bottom: -170px;
    inset-inline-end: -140px;
}

/* ---------- Card ---------- */
.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: var(--mp-radius);
    box-shadow: 0 24px 60px -24px rgba(30, 41, 59, .38);
    padding: 2.5rem;
    animation: mp-rise .5s cubic-bezier(.21, 1, .36, 1) both;
}

@keyframes mp-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Brand ---------- */
.auth-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.75rem;
}

.auth-brand img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    box-shadow: 0 8px 22px -8px rgba(32, 89, 155, .55);
}

.auth-brand h3 {
    margin: 0;
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--mp-primary-700), var(--mp-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-title {
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0 0 .25rem;
}

.auth-subtitle {
    color: var(--mp-muted);
    font-size: .95rem;
    margin-bottom: 1.5rem;
}

/* ---------- Fields ---------- */
.auth-card .form-label {
    font-weight: 600;
    color: #334155;
    font-size: .9rem;
    margin-bottom: .4rem;
}

.auth-card .form-control {
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    padding: .8rem 1rem;
    font-size: .98rem;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

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

.auth-card .form-control:focus {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 4px rgba(32, 89, 155, .16);
}

/* intl-tel-input plays nicely with rounded inputs */
.auth-card .iti { width: 100%; }

/* ---------- Button ---------- */
.btn-mp {
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-accent));
    border: none;
    color: #fff;
    font-weight: 700;
    letter-spacing: .3px;
    border-radius: 12px;
    padding: .85rem 1rem;
    box-shadow: var(--mp-shadow);
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.btn-mp:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.06);
    color: #fff;
}

.btn-mp:active:not(:disabled) { transform: translateY(0); }

.btn-mp:disabled {
    opacity: .55;
    box-shadow: none;
    cursor: not-allowed;
}

/* ---------- Links & helpers ---------- */
.auth-card a {
    color: var(--mp-primary-600);
    text-decoration: none;
    font-weight: 600;
}

.auth-card a:hover { text-decoration: underline; }

.auth-foot {
    text-align: center;
    color: var(--mp-muted);
    margin: 1.25rem 0 0;
}

.auth-link-muted { color: var(--mp-muted) !important; font-weight: 500; }


/* ============================================================
   App shell polish — scoped to .app-shell (the admin/panel body)
   Enhances the DASHMIN template using the existing brand blue.
   Applies to all HTMX-loaded partials since they render into
   #container inside .app-shell.
   ============================================================ */

/* Softer page canvas */
.app-shell .content { background: #f6f8fb; }

/* ---------- Panels / surfaces ---------- */
/* The template wraps every partial in .bg-light.rounded — turn those
   into clean white cards with a hairline border and soft shadow. */
.app-shell .content .bg-light.rounded {
    background: #ffffff !important;
    border: 1px solid #e9eef5;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px -18px rgba(25, 28, 36, .25);
}

/* ---------- Dashboard stat cards ---------- */
.app-shell .row.g-4 .bg-light.rounded {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    cursor: pointer;
}

.app-shell .row.g-4 a:hover .bg-light.rounded {
    transform: translateY(-4px);
    border-color: #cfe0f2;
    box-shadow: 0 18px 38px -18px rgba(32, 89, 155, .45);
}

.app-shell .row.g-4 .bg-light.rounded h6 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--mp-primary-700);
}

.app-shell .row.g-4 .bg-light.rounded p { color: #6b7a90; font-weight: 600; }

/* ---------- Tables ---------- */
.app-shell .table {
    border-collapse: separate;
    border-spacing: 0;
}

.app-shell .table.table-bordered,
.app-shell .table.table-bordered > :not(caption) > * > * {
    border-color: #eef2f7;
}

.app-shell .table thead th {
    background: #eef3f9;
    color: var(--mp-primary-700);
    font-weight: 700;
    border-bottom: 0;
    white-space: nowrap;
    vertical-align: middle;
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.app-shell .table tbody td { vertical-align: middle; }

.app-shell .table.table-hover tbody tr:hover > * {
    background-color: #f3f7fc;
}

/* Round the outer corners of the table */
.app-shell .table-responsive { border-radius: 12px; overflow: hidden; }

/* ---------- Sidebar active item (stronger, filled) ---------- */
.app-shell .sidebar .navbar .navbar-nav .nav-link {
    transition: background .18s ease, color .18s ease, border-color .18s ease;
    margin-bottom: 2px;
}

.app-shell .sidebar .navbar .navbar-nav .nav-link.active {
    background: var(--mp-primary);
    color: #ffffff;
    border-color: var(--mp-primary);
    box-shadow: 0 8px 20px -10px rgba(32, 89, 155, .6);
}

.app-shell .sidebar .navbar .navbar-nav .nav-link.active i { color: var(--mp-primary); }

/* ---------- Buttons ---------- */
.app-shell .btn {
    border-radius: 10px;
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.app-shell .btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 10px 22px -12px rgba(32, 89, 155, .7);
}

/* ---------- Modals ---------- */
.app-shell .modal-content {
    border: none;
    border-radius: 18px;
    box-shadow: 0 30px 70px -25px rgba(25, 28, 36, .5);
    overflow: hidden;
}

/* ---------- Footer ---------- */
.app-shell .bg-light.rounded-top {
    background: #ffffff !important;
    border: 1px solid #e9eef5;
    border-bottom: none;
}


/* ---------- Fix: top-navbar dropdowns stretching full width ---------- */
/* The template's account / bell / mail dropdowns had no width constraint,
   so they expanded across the whole navbar. Constrain to their content. */
.app-shell .content .navbar .dropdown .dropdown-menu {
    width: auto !important;
    min-width: 210px;
    max-width: 280px;
    border-radius: 12px !important;
    box-shadow: 0 16px 40px -18px rgba(25, 28, 36, .4);
    padding: .35rem;
    margin-top: .4rem !important;
}

.app-shell .content .navbar .dropdown .dropdown-item {
    border-radius: 8px;
    padding: .55rem .85rem;
}

.app-shell .content .navbar .dropdown .dropdown-item:hover {
    background: #eef3f9;
    color: var(--mp-primary-700);
}

/* ---------- Fix: footer floating mid-page with empty space below ---------- */
/* Make the content column a flexbox and let the inner container grow so the
   footer is pushed to the bottom instead of leaving a large white void. */
.app-shell .content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-shell .content > #container {
    flex: 1 0 auto;
}

.app-shell .content > .container-fluid:last-of-type {
    margin-top: auto;
}
