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

/* =========================================================================
   World Dictionary — Figma split-screen auth/portal skin
   Shared by loginNew.php, TrackMyOrderNew.php, RequestMyOrderNew.php
   Tokens lifted from the Figma exports (Login/Track/Request AR & EN).
   ========================================================================= */

:root {
    --fx-dark: #201E1E;
    --fx-gold: #FFCB00;
    --fx-surface: #FFFFFF;
    --fx-border: #F0ECE6;
    --fx-muted: #888888;
    --fx-heading: #201E1E;
    --fx-label: rgba(32, 30, 30, 0.7);
    --fx-placeholder: rgba(136, 136, 136, 0.55);
    --fx-radius: 12px;
    --fx-font-en: 'Poppins', 'Inter', system-ui, sans-serif;
    --fx-font-ar: 'Cairo', system-ui, sans-serif;
}

/* Base ------------------------------------------------------------------ */
.fx-auth *,
.fx-auth *::before,
.fx-auth *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.fx-body {
    margin: 0;
    min-height: 100vh;
    background: var(--fx-dark);
    font-family: var(--fx-font-en);
    color: var(--fx-heading);
    -webkit-font-smoothing: antialiased;
}
body.fx-body[dir="rtl"] { font-family: var(--fx-font-ar); }

/* Layout ---------------------------------------------------------------- */
.fx-auth {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    width: 100%;
}

/* form on one side, brand on the other. Brand is FIRST in the DOM, so it
   sits on the left in LTR and (because the flex main-axis reverses) on the
   right in RTL — matching the AR mockups. */
.fx-brand {
    flex: 0 0 50%;
    position: relative;
    overflow: hidden;
    background: var(--fx-dark);
}
.fx-form-side {
    flex: 1 1 50%;
    position: relative;
    display: flex;
    justify-content: center;
    background: linear-gradient(135deg, #FAF8F5 0%, #FFFFFF 50%, #F5F0E8 100%);
}

/* Request page: wider form, narrower brand */
.fx-auth--request .fx-brand { flex-basis: 40%; }
.fx-auth--request .fx-form-side { flex-basis: 60%; }

/* Brand panel decorations ---------------------------------------------- */
.fx-brand__inner {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 40px;
}

/* fanned gold rays + radial glow (approximates the Figma sunburst) */
.fx-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-conic-gradient(from 0deg at 0% 100%,
            rgba(255, 203, 0, 0.16) 0deg 0.12deg,
            rgba(255, 203, 0, 0) 0.12deg 6deg);
    -webkit-mask-image: radial-gradient(120% 120% at 0% 100%, #000 0%, rgba(0,0,0,0.35) 55%, transparent 80%);
            mask-image: radial-gradient(120% 120% at 0% 100%, #000 0%, rgba(0,0,0,0.35) 55%, transparent 80%);
    pointer-events: none;
}
.fx-brand::after {
    content: "";
    position: absolute;
    left: -80px;
    bottom: -80px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(70.71% 70.71% at 50% 50%, rgba(255, 203, 0, 0.12) 0%, rgba(255, 203, 0, 0) 70%);
    filter: blur(20px);
    pointer-events: none;
}
[dir="rtl"] .fx-brand::before { transform: scaleX(-1); }
[dir="rtl"] .fx-brand::after { left: auto; right: -80px; }

/* corner brackets */
.fx-brand__corner {
    position: absolute;
    width: 56px;
    height: 56px;
    pointer-events: none;
    z-index: 1;
}
.fx-brand__corner--tr { top: 32px; right: 32px; }
.fx-brand__corner--bl { bottom: 32px; left: 32px; }
.fx-brand__corner::before,
.fx-brand__corner::after {
    content: "";
    position: absolute;
    background: rgba(255, 203, 0, 0.25);
}
.fx-brand__corner--tr::before { top: 0; right: 0; width: 56px; height: 1px;
    background: linear-gradient(270deg, rgba(255,203,0,0.25), rgba(255,203,0,0)); }
.fx-brand__corner--tr::after  { top: 0; right: 0; width: 1px; height: 56px;
    background: linear-gradient(180deg, rgba(255,203,0,0.25), rgba(255,203,0,0)); }
.fx-brand__corner--bl::before { bottom: 0; left: 0; width: 56px; height: 1px;
    background: linear-gradient(90deg, rgba(255,203,0,0.25), rgba(255,203,0,0)); }
.fx-brand__corner--bl::after  { bottom: 0; left: 0; width: 1px; height: 56px;
    background: linear-gradient(0deg, rgba(255,203,0,0.25), rgba(255,203,0,0)); }

.fx-brand__logo {
    position: relative;
    z-index: 1;
    width: 200px;
    max-width: 60%;
    height: auto;
    filter: drop-shadow(0px 25px 25px rgba(0, 0, 0, 0.15));
}
.fx-brand__rule {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 2px;
    margin: 28px 0 18px;
    background: linear-gradient(90deg, rgba(255,203,0,0) 0%, rgba(255,203,0,0.5) 50%, rgba(255,203,0,0) 100%);
}
.fx-brand__tagline {
    position: relative;
    z-index: 1;
    max-width: 320px;
    margin: 0;
    font-size: 14px;
    line-height: 23px;
    letter-spacing: 0.7px;
    color: rgba(255, 255, 255, 0.4);
}

/* Form panel ------------------------------------------------------------ */
.fx-form {
    position: relative;
    width: 100%;
    max-width: 520px;
    padding: 96px 48px 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.fx-auth--request .fx-form { max-width: 760px; }

.fx-back {
    position: absolute;
    top: 36px;
    inset-inline-start: 48px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--fx-muted);
    text-decoration: none;
}
.fx-back:hover { color: var(--fx-dark); }
.fx-back svg { width: 16px; height: 16px; }
[dir="rtl"] .fx-back svg { transform: scaleX(-1); }

.fx-title {
    margin: 0 0 10px;
    font-family: 'Inter', var(--fx-font-en);
    font-weight: 700;
    font-size: 34px;
    line-height: 1.25;
    color: var(--fx-heading);
}
[dir="rtl"] .fx-title { font-family: var(--fx-font-ar); }
.fx-subtitle {
    margin: 0 0 32px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--fx-muted);
}
.fx-error { color: #d11a2a; font-size: 13px; margin: 0 0 16px; min-height: 0; }
.fx-hint { margin: 6px 0 0; font-size: 11px; line-height: 16px; color: rgba(136, 136, 136, 0.7); }

/* Fields ---------------------------------------------------------------- */
.fx-group { margin-bottom: 20px; }
.fx-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--fx-label);
}
.fx-label .fx-req { color: var(--fx-muted); font-weight: 400; font-size: 11px; }
/* per-label leading icon (Request form, per Figma — 14px gold) */
.fx-label .fx-label-ico {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 203, 0, 0.6);
}
.fx-label .fx-label-ico svg { width: 14px; height: 14px; display: block; }
.fx-label .fx-label-ico svg * {
    stroke: currentColor;
}

.fx-field { position: relative; }
.fx-field > .fx-ico {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(136, 136, 136, 0.6);
    pointer-events: none;
}
.fx-field > .fx-ico svg { width: 18px; height: 18px; display: block; }

/* inputs / selects shared look (also overrides bootstrap form-control/select) */
.fx-input,
.fx-form .form-control,
.fx-form .form-select {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--fx-heading);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
}
textarea.fx-input,
.fx-form textarea.form-control { height: auto; min-height: 90px; padding: 12px 16px; }

.fx-field--icon .fx-input { padding-inline-start: 46px; }
.fx-field--icon-2 .fx-input { padding-inline-start: 46px; padding-inline-end: 46px; }

.fx-input::placeholder,
.fx-form .form-control::placeholder { color: var(--fx-placeholder); }

.fx-input:focus,
.fx-form .form-control:focus,
.fx-form .form-select:focus {
    border-color: var(--fx-gold);
    box-shadow: 0 0 0 3px rgba(255, 203, 0, 0.18);
}
.fx-input.fx-invalid { border-color: #d11a2a; }

/* native select caret — arrow on the trailing edge (right in LTR, left in RTL),
   option text on the leading edge. Specificity + !important to beat style.css. */
.fx-form .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
}
body.fx-body[dir="ltr"] .fx-form .form-select {
    direction: ltr;
    text-align: left;
    background-position: right 16px center !important;
    padding-left: 16px !important;
    padding-right: 40px !important;
}
body.fx-body[dir="rtl"] .fx-form .form-select {
    direction: rtl;
    text-align: right;
    background-position: left 16px center !important;
    padding-right: 16px !important;
    padding-left: 40px !important;
}

/* show/hide password toggle */
.fx-toggle {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
    color: rgba(136, 136, 136, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fx-toggle svg { width: 20px; height: 20px; }

.fx-link {
    font-size: 14px;
    color: var(--fx-muted);
    text-decoration: none;
}
.fx-link:hover { color: var(--fx-dark); }
.fx-row-end { display: flex; justify-content: flex-end; margin: -6px 0 22px; }

/* Primary button -------------------------------------------------------- */
.fx-btn {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: var(--fx-radius);
    background: var(--fx-dark);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.fx-btn:hover { box-shadow: 0 10px 24px rgba(32, 30, 30, 0.25); }
.fx-btn:active { transform: translateY(1px); }
.fx-btn:disabled { opacity: .65; cursor: default; }
.fx-btn svg { width: 18px; height: 18px; }
.fx-btn--gold { background: var(--fx-gold); color: var(--fx-dark); }

/* Divider with gold dot ------------------------------------------------- */
.fx-divider {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 28px;
}
.fx-divider::before,
.fx-divider::after { content: ""; flex: 1; height: 1px; background: var(--fx-border); }
.fx-divider__dot { width: 36px; height: 6px; border-radius: 999px; background: rgba(255, 203, 0, 0.3); margin: 0 12px; }

.fx-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: rgba(136, 136, 136, 0.6);
}

.fx-whatsapp-line {
    margin: 14px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    color: rgba(136, 136, 136, 0.4);
}
.fx-whatsapp-line a {
    color: #009966;
    font-weight: 600;
    text-decoration: none;
}
.fx-whatsapp-line a:hover { color: #007f55; }

.fx-field-separator {
    display: flex;
    align-items: center;
    grid-column: 1 / -1;
    margin: -2px 0 2px;
}
.fx-field-separator::before,
.fx-field-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--fx-border);
}
.fx-field-separator span {
    width: 6px;
    height: 6px;
    margin: 0 12px;
    border-radius: 999px;
    background: rgba(255, 203, 0, 0.3);
}

/* Multi-column grid (Request) ------------------------------------------ */
.fx-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px 20px;
}
.fx-grid > .fx-group { grid-column: span 3; }
.fx-grid .fx-col-third { grid-column: span 2; }
.fx-grid .fx-col-12 { grid-column: 1 / -1; }

/* Request page: heading 30px / inputs 46px per Figma */
.fx-auth--request .fx-title { font-size: 30px; line-height: 38px; }
.fx-auth--request .fx-form .fx-input,
.fx-auth--request .fx-form .form-select { height: 46px; }
.fx-auth--request .fx-group { margin-bottom: 16px; }

/* file dropzone (Request) — matches the Figma "Click to upload" box */
.fx-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    min-height: 148px;
    padding: 24px 16px;
    border: 2px dashed rgba(229, 224, 216, 0.9);
    border-radius: var(--fx-radius);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.fx-drop:hover { border-color: var(--fx-gold); background: rgba(255, 203, 0, 0.04); }
.fx-drop.fx-dragover { border-color: var(--fx-gold); background: rgba(255, 203, 0, 0.08); }
.fx-drop__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F5F0E8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 203, 0, 0.9);
    margin-bottom: 10px;
}
.fx-drop__icon svg { width: 18px; height: 18px; }
.fx-drop__title { font-size: 14px; color: rgba(32, 30, 30, 0.65); }
.fx-drop__hint { margin-top: 6px; font-size: 11px; color: rgba(136, 136, 136, 0.8); }
.fx-drop__file { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--fx-dark); word-break: break-all; }
.fx-drop__file:empty { display: none; }
.fx-drop__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.fx-drop.fx-invalid { border-color: #d11a2a; }

/* phone input group: flag selector + number must stay on ONE row.
   (don't let .fx-input width:100% break the bootstrap input-group flex) */
.fx-form .input-group,
.fx-form .fx-phone {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    position: relative;
}
.fx-form .input-group > .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}
.fx-form .fx-phone > .btn {
    flex: 0 0 auto !important;
    width: 66px !important;
    min-width: 66px;
    height: 46px;
    padding: 0 8px !important;
    line-height: 44px;
    text-align: center;
    border: 1px solid var(--fx-border) !important;
    border-radius: var(--fx-radius);
    background: #fff !important;
    color: var(--fx-heading) !important;
    box-shadow: none !important;
}
/* keep the country flag rendering inline (don't let flex collapse it) */
.fx-form .fx-phone > .btn .flag-icon {
    font-size: 18px;
    vertical-align: middle;
}
.fx-form .fx-phone > .btn::after { vertical-align: middle; margin-inline-start: 4px; color: var(--fx-muted); }
/* round only the outer corners so the pair reads as one control */
body.fx-body[dir="ltr"] .fx-phone > .btn { border-start-end-radius: 0; border-end-end-radius: 0; border-inline-end: 0; }
body.fx-body[dir="ltr"] .fx-phone > .form-control { border-start-start-radius: 0; border-end-start-radius: 0; }
body.fx-body[dir="rtl"] .fx-phone > .btn { border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start: 0; }
body.fx-body[dir="rtl"] .fx-phone > .form-control { border-start-end-radius: 0; border-end-end-radius: 0; }
.fx-form .fx-phone .dropdown-menu {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    inset-inline-start: 0 !important;
    width: min(100%, 310px);
    max-height: 240px;
    overflow: auto;
    transform: none !important;
    z-index: 30;
    border: 1px solid var(--fx-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(32, 30, 30, 0.14);
}
.fx-form .fx-phone .dropdown-menu .input-group {
    cursor: pointer;
    padding: 8px 10px;
}
.fx-form .fx-phone .dropdown-menu .input-group:hover { background: #FAF8F5; }

/* Figma modal/alert skin ------------------------------------------------ */
.fx-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(32, 30, 30, 0.58);
}
.fx-modal.show { display: flex !important; }
.fx-modal__dialog {
    width: min(100%, 460px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 16px;
    background: linear-gradient(135deg, #FAF8F5 0%, #FFFFFF 58%, #F5F0E8 100%);
    box-shadow: 0 24px 70px rgba(32, 30, 30, 0.28);
}
.fx-modal__dialog--wide { width: min(100%, 980px); }
.fx-modal__body { padding: 30px; text-align: center; }
.fx-modal__icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fx-dark);
    background: rgba(255, 203, 0, 0.28);
}
.fx-modal__icon svg { width: 24px; height: 24px; }
.fx-modal__title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fx-heading);
}
.fx-modal__text {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--fx-muted);
}
.fx-modal__input {
    text-align: center;
    direction: ltr;
    letter-spacing: 5px;
    font-size: 18px !important;
    font-weight: 700;
}
.fx-modal__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}
.fx-modal__close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(32, 30, 30, 0.08);
    color: var(--fx-heading);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.fx-modal__close svg { width: 18px; height: 18px; }
.fx-modal__header {
    display: flex;
    justify-content: flex-end;
    padding: 18px 18px 0;
}
.fx-modal__content { padding: 0 24px 26px; }
.fx-modal__content .card {
    border: 1px solid var(--fx-border);
    border-radius: 12px;
    box-shadow: none;
}
.fx-modal__content .card-header { background: #fff; border-bottom: 1px solid var(--fx-border); }
.fx-modal__content .bg-primary { background: var(--fx-dark) !important; color: #fff; }
.fx-modal__content .table { margin-bottom: 0; }

/* Restyle the legacy ActionAlertXX popup when used by the new Figma pages. */
body.fx-body #popupLayerAlert.popup {
    position: fixed;
    inset: 0;
    z-index: 1070;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(32, 30, 30, 0.58);
}
body.fx-body #popupLayerAlert[style*="block"] { display: flex !important; }
body.fx-body #popupLayerAlert .popup-content,
body.fx-body #popupLayerAlert .alert-box,
body.fx-body #popupLayerAlert .alert {
    width: min(100%, 460px);
    margin: 0;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #FAF8F5 0%, #FFFFFF 58%, #F5F0E8 100%);
    box-shadow: 0 24px 70px rgba(32, 30, 30, 0.28);
}
body.fx-body #popupLayerAlert .alert-body { padding: 30px; }
body.fx-body #popupLayerAlert svg {
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: rgba(255, 203, 0, 0.28);
}
body.fx-body #popupLayerAlert svg rect,
body.fx-body #popupLayerAlert svg image { display: none; }
body.fx-body #popupLayerAlert h4 {
    font-size: 18px;
    line-height: 1.7;
    color: var(--fx-heading) !important;
}
body.fx-body #popupLayerAlert .btn-warning {
    min-width: 130px;
    height: 46px;
    border: 0;
    border-radius: var(--fx-radius);
    background: var(--fx-dark);
    color: #fff;
    font-weight: 600;
}

/* Responsive ------------------------------------------------------------ */
@media (max-width: 991px) {
    .fx-form { padding-top: 84px; }
    .fx-auth--request .fx-form { max-width: 620px; }
}
@media (max-width: 767px) {
    .fx-auth, .fx-auth--request { flex-direction: column; }
    .fx-brand, .fx-auth--request .fx-brand { flex-basis: auto; }
    .fx-brand__inner { position: static; height: auto; padding: 40px 24px 36px; }
    .fx-brand__logo { width: 150px; }
    .fx-brand__tagline { font-size: 13px; }
    .fx-form, .fx-auth--request .fx-form {
        max-width: 100%;
        padding: 64px 22px 48px;
    }
    .fx-grid { grid-template-columns: 1fr; }
    .fx-grid > .fx-group,
    .fx-grid .fx-col-third,
    .fx-grid .fx-col-12 { grid-column: 1 / -1; }
    .fx-back { top: 20px; inset-inline-start: 22px; }
    .fx-title { font-size: 27px; }
}
