:root {
    --login-primary: #087565;
    --login-primary-dark: #053f38;
    --login-primary-soft: #e8f8f4;
    --login-surface: #ffffff;
    --login-background: #f2f8f6;
    --login-border: #dce9e6;
    --login-text: #143b35;
    --login-muted: #738783;
    --login-danger: #b42318;
    --login-success: #147552;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--login-text);
    background: var(--login-background);
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
    min-height: 100vh;
}

.login-intro {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 5vw, 68px);
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 20% 15%,
            rgba(75, 227, 190, 0.2),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            #043d36,
            #087565
        );
}

.login-intro::after {
    position: absolute;
    inset-inline-end: -180px;
    bottom: -210px;
    width: 500px;
    height: 500px;
    content: "";
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.login-intro__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.login-intro__glow--one {
    top: 18%;
    inset-inline-start: -120px;
    width: 260px;
    height: 260px;
    background: rgba(117, 255, 218, 0.07);
}

.login-intro__glow--two {
    top: 48%;
    inset-inline-end: 9%;
    width: 180px;
    height: 180px;
    background: rgba(105, 210, 255, 0.05);
}

.login-brand,
.login-intro__content,
.login-intro__footer {
    position: relative;
    z-index: 1;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand__logo {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    place-items: center;
    color: #075e51;
    background: #d7fff5;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.login-brand__logo svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.login-brand__content strong,
.login-brand__content small {
    display: block;
}

.login-brand__content strong {
    font-size: 22px;
    font-weight: 900;
}

.login-brand__content small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
}

.login-intro__content {
    max-width: 650px;
    margin-block: 55px;
}

.login-intro__eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 10px;
    color: #bbf7e8;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.login-intro h1 {
    max-width: 600px;
    margin: 0;
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 900;
    line-height: 1.25;
}

.login-intro__content > p {
    max-width: 600px;
    margin: 17px 0 0;
    color: rgba(255, 255, 255, 0.73);
    font-size: 15px;
    line-height: 2;
}

.login-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.login-feature {
    min-width: 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.login-feature__icon {
    display: grid;
    width: 36px;
    height: 36px;
    margin-bottom: 11px;
    place-items: center;
    color: #bff9e9;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.login-feature__icon svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.login-feature strong,
.login-feature span {
    display: block;
}

.login-feature strong {
    font-size: 12px;
}

.login-feature > div > span {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.57);
    font-size: 10px;
    line-height: 1.65;
}

.login-intro__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 20px;
    color: rgba(255, 255, 255, 0.52);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    font-size: 10px;
}

.login-system-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.login-system-status > span {
    width: 8px;
    height: 8px;
    background: #57e3bd;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(87, 227, 189, 0.1);
}

.login-panel {
    display: grid;
    min-width: 0;
    min-height: 100vh;
    place-items: center;
    padding: 40px;
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(8, 117, 101, 0.06),
            transparent 28%
        ),
        var(--login-background);
}

.login-form-wrap {
    width: min(470px, 100%);
    padding: clamp(26px, 4vw, 38px);
    background: var(--login-surface);
    border: 1px solid var(--login-border);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(20, 72, 62, 0.1);
}

.login-form-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.login-form-header__icon {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--login-primary);
    background: var(--login-primary-soft);
    border-radius: 15px;
}

.login-form-header__icon svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.login-form-header__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--login-primary);
    font-size: 10px;
    font-weight: 800;
}

.login-form-header h2 {
    margin: 0;
    color: var(--login-text);
    font-size: 27px;
    font-weight: 900;
}

.login-form-header p {
    margin: 7px 0 0;
    color: var(--login-muted);
    font-size: 13px;
    line-height: 1.8;
}

.login-alerts {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.login-alerts:empty {
    display: none;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.7;
}

.login-alert svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    margin-top: 1px;
    fill: currentColor;
}

.login-alert--success {
    color: var(--login-success);
    background: #effaf4;
    border-color: #cbe9d8;
}

.login-alert--danger {
    color: var(--login-danger);
    background: #fff4f3;
    border-color: #f3ccc8;
}

.login-form {
    margin-top: 25px;
}

.login-field + .login-field {
    margin-top: 18px;
}

.login-field label {
    display: block;
    margin-bottom: 8px;
    color: #425f59;
    font-size: 12px;
    font-weight: 800;
}

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

.login-input-wrap__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    color: #7a8f8a;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input-wrap__icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.login-input-wrap input {
    width: 100%;
    min-height: 50px;
    padding: 12px 45px 12px 48px;
    color: var(--login-text);
    background: #fbfdfc;
    border: 1px solid var(--login-border);
    border-radius: 13px;
    outline: 0;
    font-size: 13px;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.login-input-wrap input::placeholder {
    color: #a2b0ad;
}

.login-input-wrap input:focus {
    background: #ffffff;
    border-color: var(--login-primary);
    box-shadow: 0 0 0 4px rgba(8, 117, 101, 0.1);
}

.login-input-wrap input.is-invalid {
    border-color: #d75950;
    box-shadow: 0 0 0 4px rgba(215, 89, 80, 0.08);
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    color: #718682;
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transform: translateY(-50%);
}

.login-password-toggle:hover {
    color: var(--login-primary);
    background: var(--login-primary-soft);
}

.login-password-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.login-password-toggle__hide {
    display: none;
}

.login-password-toggle.is-visible .login-password-toggle__show {
    display: none;
}

.login-password-toggle.is-visible .login-password-toggle__hide {
    display: block;
}

.login-field-error {
    margin-top: 7px;
    color: var(--login-danger);
    font-size: 11px;
    font-weight: 700;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
    color: #536c66;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.login-remember > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.login-remember__control {
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    color: transparent;
    background: #ffffff;
    border: 1px solid #cbdad6;
    border-radius: 6px;
    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

.login-remember__control svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.login-remember > input:checked + .login-remember__control {
    color: #ffffff;
    background: var(--login-primary);
    border-color: var(--login-primary);
}

.login-remember > input:focus-visible + .login-remember__control {
    outline: 3px solid rgba(8, 117, 101, 0.18);
    outline-offset: 2px;
}

.login-submit {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 25px;
    padding: 12px 18px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--login-primary-dark),
        var(--login-primary)
    );
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 12px 25px rgba(8, 117, 101, 0.18);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(8, 117, 101, 0.23);
}

.login-submit:disabled {
    cursor: wait;
    opacity: 0.75;
    transform: none;
}

.login-submit > svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.login-submit__loading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.login-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: login-spin 0.7s linear infinite;
}

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    color: #82938f;
    border-top: 1px solid var(--login-border);
    font-size: 10px;
    text-align: center;
}

.login-security-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: currentColor;
}

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

:focus-visible {
    outline: 3px solid rgba(8, 117, 101, 0.2);
    outline-offset: 3px;
}

@media (max-width: 1050px) {
    .login-shell {
        grid-template-columns: minmax(360px, 0.85fr) minmax(460px, 1.15fr);
    }

    .login-features {
        grid-template-columns: 1fr;
    }

    .login-feature {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .login-feature__icon {
        margin-bottom: 0;
        flex: 0 0 auto;
    }
}

@media (max-width: 820px) {
    .login-shell {
        display: block;
    }

    .login-intro {
        min-height: auto;
        padding: 28px 24px;
    }

    .login-intro__content {
        margin: 45px 0 30px;
    }

    .login-intro h1 {
        max-width: 540px;
        font-size: clamp(30px, 8vw, 44px);
    }

    .login-features {
        display: none;
    }

    .login-intro__footer {
        display: none;
    }

    .login-panel {
        min-height: auto;
        padding: 28px 18px 45px;
    }

    .login-form-wrap {
        margin-top: -8px;
    }
}

@media (max-width: 520px) {
    .login-intro {
        padding: 23px 18px 35px;
    }

    .login-brand__logo {
        width: 45px;
        height: 45px;
        border-radius: 14px;
    }

    .login-brand__content strong {
        font-size: 19px;
    }

    .login-intro__content {
        margin: 35px 0 0;
    }

    .login-intro__eyebrow {
        display: none;
    }

    .login-intro h1 {
        font-size: 30px;
    }

    .login-intro__content > p {
        font-size: 13px;
    }

    .login-panel {
        padding: 0 12px 28px;
        background: var(--login-background);
    }

    .login-form-wrap {
        margin-top: -14px;
        padding: 22px 18px;
        border-radius: 20px;
    }

    .login-form-header__icon {
        width: 43px;
        height: 43px;
        border-radius: 13px;
    }

    .login-form-header h2 {
        font-size: 23px;
    }

    .login-input-wrap input {
        min-height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}