/* ==========================================================================
   Mash.Apartments — Premium Login
   Split layout: left hero (deep emerald + animated apartment skyline) /
   right form panel (warm white card with emerald accents).
   ========================================================================== */

.apx-login {
    min-height: 100vh;
    background: #04201A;
    color: #1C1917;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.apx-login-shell {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 100vh;
}
@media (max-width: 991.98px) {
    .apx-login-shell { grid-template-columns: 1fr; }
}

/* ==========================================================================
   LEFT HERO — deep emerald + warm gold + animated skyline
   ========================================================================== */
.apx-login-hero {
    position: relative;
    overflow: hidden;
    padding: 3.5rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ECFDF5;
    background:
        radial-gradient(900px 500px at 12% -10%, rgba(217, 119, 6, 0.22), transparent 60%),
        radial-gradient(1100px 600px at 110% 110%, rgba(16, 185, 129, 0.30), transparent 60%),
        linear-gradient(135deg, #04201A 0%, #064E3B 50%, #052D24 100%);
}
@media (max-width: 991.98px) {
    .apx-login-hero { display: none; }
}

/* Subtle architectural grid texture overlay */
.apx-login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
}

/* ----- Brand block (top-left) ----- */
.apx-hero-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    z-index: 2;
}
.apx-hero-brand .mark {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    box-shadow:
        0 12px 30px -8px rgba(16, 185, 129, 0.55),
        inset 0 1px 0 rgba(255,255,255,0.30);
    color: #FFFFFF;
    font-size: 1.5rem;
}
.apx-hero-brand .wordmark { line-height: 1.1; }
.apx-hero-brand .wordmark strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}
.apx-hero-brand .wordmark small {
    display: block;
    font-size: 0.75rem;
    color: rgba(236, 253, 245, 0.6);
    letter-spacing: 0.04em;
}

/* ==========================================================================
   STAGE — animated skyline of three towers + floating KPI cards
   ========================================================================== */
.apx-hero-stage {
    position: relative;
    height: 320px;
    margin: 1.5rem 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1;
}

.apx-stage-skyline {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 22px;
    padding-bottom: 8px;
}

/* ----- Towers ----- */
.apx-tower {
    position: relative;
    width: 90px;
    background: linear-gradient(180deg, rgba(20, 83, 64, 0.92) 0%, rgba(6, 78, 59, 0.96) 100%);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 40px -16px rgba(0, 0, 0, 0.6);
}
.apx-tower.t1 { height: 200px; }
.apx-tower.t2 { height: 260px; }
.apx-tower.t2.tall { height: 280px; }
.apx-tower.t3 { height: 175px; }

.apx-tower-roof {
    position: absolute;
    inset-block-start: -12px;
    inset-inline: 14px;
    height: 12px;
    background: linear-gradient(180deg, #047857 0%, #064E3B 100%);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    box-shadow: 0 -4px 14px -4px rgba(16, 185, 129, 0.45);
}
.apx-tower.t2 .apx-tower-roof::before {
    /* Antenna spike for the tallest tower */
    content: '';
    position: absolute;
    inset-block-start: -22px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 2px; height: 22px;
    background: linear-gradient(180deg, transparent, #FBBF24);
}
.apx-tower.t2 .apx-tower-roof::after {
    content: '';
    position: absolute;
    inset-block-start: -28px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #FBBF24;
    box-shadow: 0 0 12px #FBBF24;
    animation: apx-blink 2s ease-in-out infinite;
}
@keyframes apx-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

/* ----- Tower body — grid of windows ----- */
.apx-tower-body {
    height: 100%;
    padding: 14px 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.apx-window {
    background: rgba(15, 76, 60, 0.7);
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
/* Lit windows — pseudo-random offsets via :nth-child for a non-uniform pattern */
.apx-tower .apx-window:nth-child(3n+1),
.apx-tower .apx-window:nth-child(7n+2) {
    background: linear-gradient(180deg, #FCD34D 0%, #F59E0B 100%);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.55), inset 0 1px 0 rgba(255,255,255,0.45);
    animation: apx-flicker 6s ease-in-out infinite;
}
.apx-tower .apx-window:nth-child(5n+1) {
    background: linear-gradient(180deg, #6EE7B7 0%, #10B981 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255,255,255,0.45);
    animation: apx-flicker 7.5s ease-in-out infinite;
    animation-delay: 1.1s;
}
.apx-tower .apx-window:nth-child(11n+5) {
    background: linear-gradient(180deg, #FFFFFF 0%, #ECFDF5 100%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
@keyframes apx-flicker {
    0%, 92%, 100% { filter: brightness(1); }
    93%, 96%      { filter: brightness(0.55); }
}

/* Subtle ground line under the towers */
.apx-stage-skyline::after {
    content: '';
    position: absolute;
    inset-block-end: 0;
    inset-inline: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(16, 185, 129, 0.4) 30%,
        rgba(217, 119, 6, 0.5) 70%,
        transparent 100%);
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.5);
}

/* ----- Floating KPI cards ----- */
.apx-stat {
    position: absolute;
    background: rgba(8, 47, 36, 0.85);
    border: 1px solid rgba(110, 231, 183, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    color: #ECFDF5;
    font-size: 0.78rem;
    line-height: 1.25;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.55);
    animation: apx-float 7s ease-in-out infinite;
    z-index: 2;
}
.apx-stat .label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(236, 253, 245, 0.55);
    font-weight: 700;
    margin-bottom: 2px;
}
.apx-stat .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.apx-stat .accent { color: #FBBF24; font-weight: 800; }
.apx-stat .accent-success { color: #6EE7B7; font-weight: 800; }

.apx-stat.stat-1 { top: 12%;  inset-inline-start: 4%; animation-delay: 0s; }
.apx-stat.stat-2 { top: 18%;  inset-inline-end: 6%;  animation-delay: 1.4s; }
.apx-stat.stat-3 { bottom: 22%; inset-inline-start: 8%; animation-delay: 2.6s; }
.apx-stat.stat-4 { bottom: 14%; inset-inline-end: 4%;  animation-delay: 3.8s; }

@keyframes apx-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* ----- Hero bottom: tagline + features grid ----- */
.apx-hero-tag {
    position: relative;
    z-index: 2;
}
.apx-hero-tag .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(236, 253, 245, 0.7);
    margin-bottom: 0.85rem;
}
.apx-hero-tag .eyebrow .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #6EE7B7;
    box-shadow: 0 0 12px #10B981;
    animation: apx-pulse 1.8s ease-in-out infinite;
}
@keyframes apx-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.7; }
}

.apx-hero-tag h1 {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    margin: 0 0 0.85rem;
    max-width: 520px;
}
.apx-hero-tag h1 .grad {
    background: linear-gradient(90deg, #6EE7B7 0%, #FCD34D 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.apx-hero-tag p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(236, 253, 245, 0.78);
    margin: 0;
    max-width: 520px;
}

.apx-hero-foot {
    position: relative;
    z-index: 2;
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.25rem;
}
.apx-feature {
    display: flex; gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(110, 231, 183, 0.18);
    background: rgba(6, 78, 59, 0.45);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.apx-feature:hover {
    background: rgba(6, 78, 59, 0.65);
    border-color: rgba(110, 231, 183, 0.35);
    transform: translateY(-2px);
}
.apx-feature .fi {
    width: 36px; height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    color: #FFFFFF;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
}
.apx-feature h5 {
    margin: 0 0 1px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}
.apx-feature p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(236, 253, 245, 0.65);
}

/* ==========================================================================
   RIGHT PANEL — login form
   ========================================================================== */
.apx-login-panel {
    background: linear-gradient(180deg, #FAFAF9 0%, #F5F5F4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.apx-login-card {
    width: 100%;
    max-width: 420px;
    background: #FFFFFF;
    border-radius: 22px;
    padding: 2.5rem 2.25rem;
    border: 1px solid #E7E5E4;
    box-shadow:
        0 30px 60px -22px rgba(15, 23, 42, 0.20),
        0 8px 18px -4px rgba(15, 23, 42, 0.06);
}

.apx-login-mini-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.apx-login-mini-brand .mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    color: #FFFFFF;
    font-size: 1.15rem;
    box-shadow: 0 6px 14px -4px rgba(16, 185, 129, 0.45);
}
.apx-login-mini-brand strong {
    font-size: 1rem;
    font-weight: 800;
    color: #1C1917;
    letter-spacing: -0.01em;
}

.apx-login-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1C1917;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}
.apx-login-sub {
    color: #57534E;
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

/* ----- Fields ----- */
.apx-field { margin-bottom: 0.95rem; }
.apx-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #44403C;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}
.apx-field .wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.apx-field .wrap > i {
    position: absolute;
    inset-inline-start: 14px;
    color: #A8A29E;
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.15s ease;
}
.apx-field input {
    width: 100%;
    padding: 0.85rem 0.9rem 0.85rem 2.6rem;
    border: 1.5px solid #E7E5E4;
    border-radius: 12px;
    background: #FFFFFF;
    font-size: 0.92rem;
    color: #1C1917;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
}
.apx-field input::placeholder { color: #A8A29E; }
.apx-field input:focus {
    outline: 0;
    border-color: #10B981;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}
.apx-field .wrap:focus-within > i { color: #047857; }

.apx-field .toggle-password {
    position: absolute;
    inset-inline-end: 8px;
    width: 34px; height: 34px;
    border: 0;
    background: transparent;
    color: #78716C;
    cursor: pointer;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.12s ease, color 0.12s ease;
}
.apx-field .toggle-password:hover { background: #F5F5F4; color: #1C1917; }

/* ----- Remember me + forgot row ----- */
.apx-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.4rem 0 1.25rem;
}
.apx-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #44403C;
    cursor: pointer;
    user-select: none;
}
.apx-remember input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #047857;
    cursor: pointer;
}
.apx-forgot {
    font-size: 0.85rem;
    font-weight: 600;
    color: #047857;
    text-decoration: none;
    transition: color 0.12s ease;
}
.apx-forgot:hover { color: #064E3B; text-decoration: underline; }

/* ----- Submit button ----- */
.apx-login-btn {
    position: relative;
    width: 100%;
    padding: 0.95rem 1.25rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow:
        0 14px 30px -10px rgba(16, 185, 129, 0.55),
        inset 0 1px 0 rgba(255,255,255,0.20);
    transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.2s ease;
    overflow: hidden;
}
.apx-login-btn .label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.apx-login-btn .label i { transition: transform 0.18s ease; }
.apx-login-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 18px 38px -8px rgba(16, 185, 129, 0.65),
        inset 0 1px 0 rgba(255,255,255,0.25);
}
.apx-login-btn:hover .label i { transform: translateX(3px); }
.apx-login-btn:active { transform: translateY(0); }

/* Loading state — replace label with spinner */
.apx-login-btn .spin {
    position: absolute;
    inset-inline-start: 50%;
    inset-block-start: 50%;
    transform: translate(-50%, -50%);
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.apx-login-btn.is-loading .spin { opacity: 1; animation: apx-spin 0.7s linear infinite; }
.apx-login-btn.is-loading .label { opacity: 0; }
@keyframes apx-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.apx-login-btn[disabled] { cursor: progress; }

/* ----- Error pill ----- */
.apx-login-error {
    margin-top: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.apx-login-error.is-shown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ----- Card footer ----- */
.apx-login-foot {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px dashed #E7E5E4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #78716C;
}
.apx-login-foot .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ECFDF5;
    color: #065F46;
    font-weight: 700;
    letter-spacing: 0.06em;
    border: 1px solid #A7F3D0;
}

/* RTL niceties for Arabic */
[dir="rtl"] .apx-field .wrap > i { inset-inline-start: auto; inset-inline-end: 14px; }
[dir="rtl"] .apx-field input { padding: 0.85rem 2.6rem 0.85rem 0.9rem; }
[dir="rtl"] .apx-login-btn .label i { transform: scaleX(-1); }
[dir="rtl"] .apx-login-btn:hover .label i { transform: scaleX(-1) translateX(3px); }
