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

:root {
    --ms-ink: #17120f;
    --ms-coffee: #3e2f26;
    --ms-bronze: #9a7657;
    --ms-sand: #bbad9e;
    --ms-soft: rgba(255, 255, 255, 0.78);
    --ms-border: rgba(62, 47, 38, 0.14);
    --ms-shadow: 0 28px 70px rgba(38, 28, 22, 0.22);
}

* {
    box-sizing: border-box;
}

body.login-page {
    min-height: 100vh;
    margin: 0;
    font-family: 'Tajawal', sans-serif;
    color: var(--ms-ink);
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.52), transparent 28%),
        radial-gradient(circle at 84% 78%, rgba(85, 62, 46, 0.24), transparent 30%),
        linear-gradient(135deg, #d7cabc 0%, var(--ms-sand) 48%, #8f7c69 100%);
}

.ms-login-shell {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    padding: 24px 18px;
}

.ms-login-shell::before,
.ms-login-shell::after {
    position: absolute;
    content: "";
    border-radius: 999px;
    pointer-events: none;
}

.ms-login-shell::before {
    width: 420px;
    height: 420px;
    inset: -140px auto auto -120px;
    background: rgba(255, 255, 255, 0.22);
    filter: blur(4px);
}

.ms-login-shell::after {
    width: 520px;
    height: 520px;
    inset: auto -190px -180px auto;
    background: rgba(62, 47, 38, 0.18);
    filter: blur(6px);
}

.ms-login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 470px);
    padding: 28px 36px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 26px;
    background: var(--ms-soft);
    box-shadow: var(--ms-shadow);
    backdrop-filter: blur(20px);
}

.ms-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    text-align: center;
}

.ms-login-logo-frame {
    display: grid;
    width: 118px;
    height: 118px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: linear-gradient(145deg, #251d18, #050403);
    box-shadow: 0 18px 38px rgba(62, 47, 38, 0.22);
}

.ms-login-logo-frame img {
    max-width: 88px;
    max-height: 88px;
    object-fit: contain;
}

.ms-login-title {
    margin: 0;
    color: var(--ms-coffee);
    font-size: 29px;
    font-weight: 800;
    line-height: 1.25;
}

.ms-login-subtitle {
    max-width: 310px;
    margin: 6px auto 0;
    color: rgba(23, 18, 15, 0.64);
    font-size: 15px;
    line-height: 1.8;
}

.ms-login-form {
    display: grid;
    gap: 14px;
    direction: rtl;
    text-align: right;
}

.ms-login-field {
    direction: rtl;
    text-align: right;
}

.ms-login-field label {
    display: block;
    width: 100%;
    margin-bottom: 9px;
    color: var(--ms-coffee);
    font-size: 15px;
    font-weight: 700;
    direction: rtl;
    text-align: right;
}

.ms-login-field label span {
    color: var(--ms-bronze);
}

.ms-login-input-wrap {
    position: relative;
}

.ms-login-input-wrap i {
    position: absolute;
    top: 50%;
    left: 18px;
    color: rgba(62, 47, 38, 0.48);
    font-size: 17px;
    transform: translateY(-50%);
}

.ms-login-input {
    width: 100%;
    height: 52px;
    padding: 0 18px 0 50px;
    border: 1px solid var(--ms-border);
    border-radius: 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ms-ink);
    direction: rtl !important;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    text-align: right !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ms-login-input:focus {
    border-color: rgba(154, 118, 87, 0.76);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0 0 4px rgba(154, 118, 87, 0.14);
}

.ms-login-password-wrap .ms-login-input::-ms-reveal,
.ms-login-password-wrap .ms-login-input::-ms-clear {
    display: none;
}

.ms-password-toggle {
    position: absolute;
    top: 50%;
    left: 1px;
    display: inline-flex;
    width: 17px;
    height: 17px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(62, 47, 38, 0.52);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    transform: translateY(-50%);
    transition: background 0.18s ease, color 0.18s ease;
}

.ms-password-toggle:hover,
.ms-password-toggle:focus {
    background: transparent;
    color: var(--ms-coffee);
    outline: none;
}

.ms-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: -2px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: rgba(23, 18, 15, 0.7);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
}

.remember-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ms-coffee);
}

.ms-login-submit {
    display: inline-flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    border: 0;
    border-radius: 17px;
    background: linear-gradient(135deg, var(--ms-ink), var(--ms-coffee) 62%, #6d503c);
    box-shadow: 0 18px 32px rgba(62, 47, 38, 0.28);
    color: #fff;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ms-login-submit:hover,
.ms-login-submit:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(62, 47, 38, 0.34);
}

.ms-login-submit[disabled],
.ms-login-submit.is-loading {
    cursor: wait;
    opacity: 0.88;
    transform: none;
}

.ms-login-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ms-login-spin 0.75s linear infinite;
}

.ms-login-submit.is-loading .ms-login-spinner {
    display: inline-block;
}

.ms-login-note {
    margin: 6px 0 0;
    color: rgba(23, 18, 15, 0.55);
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.text-danger {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    font-weight: 600;
}

body.login-page .alert {
    position: fixed;
    top: 18px;
    left: 50%;
    right: auto;
    z-index: 2;
    width: min(680px, calc(100% - 32px));
    max-width: none;
    margin: 0;
    border-radius: 14px;
    font-family: 'Tajawal', sans-serif;
    text-align: right;
    transform: translateX(-50%);
    box-shadow: 0 16px 34px rgba(62, 47, 38, 0.16);
}

body.login-page .alert .close {
    position: absolute;
    top: 50%;
    left: 16px;
    right: auto;
    transform: translateY(-50%);
}

body.login-page #phpdebugbar,
body.login-page .phpdebugbar {
    display: none !important;
}

@keyframes ms-login-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-height: 760px) {
    .ms-login-shell {
        align-items: center;
    }
}

@media (max-width: 576px) {
    .ms-login-shell {
        min-height: 100svh;
        align-items: center;
        padding: 22px 14px;
    }

    .ms-login-card {
        padding: 26px 20px;
        border-radius: 22px;
    }

    .ms-login-logo-frame {
        width: 108px;
        height: 108px;
    }

    .ms-login-title {
        font-size: 26px;
    }

    .ms-login-subtitle {
        font-size: 14px;
    }

    .ms-login-input {
        height: 52px;
        font-size: 15px;
    }

    .shop.login.section {
        display: flex;
        min-height: 100svh;
        align-items: center;
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .shop.login.section .container {
        width: 100%;
    }
}
