:root {
    --sky-deep: #6b4a2e;
    --sky-mid: #c4a574;
    --sky-soft: #e6d5b8;
    --sky-mist: #f6efe4;
    --white: #fffdf8;
    --ink: #3d2a1c;
    --ink-muted: #7a6452;
    --shadow: rgba(110, 80, 45, 0.18);
    --shadow-soft: rgba(140, 110, 70, 0.12);
    --glass: rgba(255, 252, 247, 0.84);
    --radius-panel: 28px;
    --radius-card: 26px;
    --font-display: "Tajawal", "Segoe UI", sans-serif;
    --font-body: "Tajawal", "Segoe UI", sans-serif;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

.login-body {
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--sky-mist);
    -webkit-font-smoothing: antialiased;
}

.login-sky {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow: hidden;
    background-color: #eadcc6;
    background-image: var(--sky-image);
    background-size: cover;
    background-position: center;
}

.login-sky__veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(255, 248, 232, 0.32) 0%, transparent 70%),
        linear-gradient(180deg, rgba(255, 250, 240, 0.38) 0%, rgba(246, 239, 228, 0.52) 100%);
    z-index: 0;
}

.login-sky__glow {
    position: absolute;
    width: 46vw;
    height: 46vw;
    top: -12%;
    left: 18%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 244, 214, 0.7) 0%, rgba(196, 165, 116, 0.16) 45%, transparent 70%);
    filter: blur(8px);
    z-index: 0;
    pointer-events: none;
}

.login-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2.5rem 1.5rem 3rem;
}

.login-atelier {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}

.login-art {
    perspective: 1600px;
    display: flex;
    justify-content: center;
}

.art-panel {
    position: relative;
    width: min(100%, 420px);
    transform-style: preserve-3d;
    transform: rotateY(9deg) rotateX(3deg);
    animation: art-float 8s ease-in-out infinite;
}

.art-panel__frame {
    position: relative;
    padding: 14px;
    border-radius: var(--radius-panel);
    background:
        linear-gradient(165deg, #fffaf0 0%, #f4ead6 42%, #e8d5b0 100%);
    box-shadow:
        0 1px 0 rgba(255, 252, 245, 0.95) inset,
        0 18px 40px var(--shadow),
        0 6px 14px var(--shadow-soft),
        0 40px 80px rgba(140, 105, 60, 0.16);
}

.art-panel__slab {
    position: absolute;
    inset: 10px -10px -14px 10px;
    border-radius: 24px;
    background: linear-gradient(160deg, #e2c896 0%, #c4a574 100%);
    transform: translateZ(-22px);
    filter: blur(0.4px);
    opacity: 0.72;
    z-index: -1;
}

.art-panel__frame::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 22px;
    border: 1px solid rgba(255, 248, 232, 0.85);
    box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.4);
    pointer-events: none;
    z-index: 2;
}

.art-panel__canvas {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background: #e8d7b8;
    transform: translateZ(18px);
}

.art-panel__canvas img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center center;
    filter: saturate(1.04) contrast(1.03);
}

.art-panel__varnish {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(255, 244, 214, 0.22) 0%, transparent 36%, rgba(120, 80, 40, 0.08) 100%);
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.art-panel__caption {
    margin: 1rem 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transform: translateZ(8px);
}

.art-panel__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink);
}

.art-panel__seal {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px var(--shadow-soft);
    color: var(--sky-deep);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.art-panel__seal svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.login-card {
    position: relative;
    padding: clamp(1.75rem, 3.5vw, 2.6rem);
    border-radius: var(--radius-card);
    background: var(--glass);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow:
        0 1px 0 #fff inset,
        0 16px 40px var(--shadow),
        0 2px 8px var(--shadow-soft);
}

.login-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.28);
}

.login-brand {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.6rem;
}

.login-brand__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--sky-deep);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-brand__name {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4vw, 2.85rem);
    font-weight: 600;
    line-height: 1.1;
    color: var(--ink);
}

.login-brand__lead {
    margin: 0.35rem 0 0;
    color: var(--ink-muted);
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.7;
}

.login-status {
    margin-bottom: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(232, 248, 239, 0.9);
    color: #1e6b45;
    font-size: 0.88rem;
}

.login-form {
    display: grid;
    gap: 1.05rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.42rem;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink);
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(196, 165, 116, 0.55);
    background: rgba(255, 252, 247, 0.94);
    color: var(--ink);
    font-family: inherit;
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(140, 105, 60, 0.08);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
    border-color: var(--sky-mid);
    box-shadow: 0 0 0 4px rgba(196, 165, 116, 0.28);
}

.login-errors {
    margin: 0.45rem 0 0;
    padding: 0;
    list-style: none;
    color: #b42318;
    font-size: 0.8rem;
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--ink-muted);
    cursor: pointer;
}

.login-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--sky-deep);
}

.login-link {
    color: var(--sky-deep);
    font-size: 0.88rem;
    text-decoration: none;
    font-weight: 500;
}

.login-link:hover {
    text-decoration: underline;
}

.login-submit {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.95rem 1.2rem;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #c4a05a 0%, #8b5e2b 100%);
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(139, 94, 43, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-submit:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(139, 94, 43, 0.32);
}

.login-submit:active {
    transform: translateY(0);
}

.login-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin: 1.2rem 0 0;
    color: var(--ink-muted);
    font-size: 0.78rem;
}

.login-privacy svg {
    width: 14px;
    height: 14px;
    color: var(--sky-deep);
}

.otp {
    display: grid;
    gap: 0.7rem;
}

.otp__label {
    display: block;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink);
}

.otp__cells {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.45rem;
}

.otp__cell {
    width: 100%;
    aspect-ratio: 0.82;
    min-height: 3.15rem;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(196, 165, 116, 0.55);
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(248, 239, 220, 0.92) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 8px 18px rgba(140, 105, 60, 0.08);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
    text-align: center;
    caret-color: var(--sky-deep);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}

.otp__cell:focus {
    border-color: #c4a05a;
    box-shadow: 0 0 0 4px rgba(196, 165, 116, 0.28);
    transform: translateY(-1px);
}

.otp__hint {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.otp__cells.is-busy .otp__cell {
    opacity: 0.7;
}

.otp__cells.is-error .otp__cell {
    border-color: #b42318;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
    color: #8a1f16;
}

.otp__cells.is-ok .otp__cell {
    border-color: #b0893a;
    box-shadow: 0 0 0 4px rgba(196, 160, 90, 0.22);
}

.otp__cells.is-shake {
    animation: otp-shake 0.42s ease;
}

.welcome {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    background: rgba(46, 32, 18, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.welcome.is-on {
    opacity: 1;
    pointer-events: auto;
}

.welcome__glow {
    position: absolute;
    width: 42rem;
    height: 42rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 236, 186, 0.55) 0%, rgba(196, 160, 90, 0.08) 46%, transparent 70%);
    filter: blur(8px);
}

.welcome__panel {
    position: relative;
    width: min(420px, calc(100% - 2rem));
    padding: 2.4rem 2rem;
    border-radius: 28px;
    text-align: center;
    background: rgba(255, 252, 247, 0.92);
    border: 1px solid rgba(255, 248, 232, 0.95);
    box-shadow:
        0 1px 0 #fff inset,
        0 24px 60px rgba(110, 80, 45, 0.22);
    transform: translateY(18px) scale(0.96);
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.welcome.is-on .welcome__panel {
    transform: translateY(0) scale(1);
}

.welcome__eyebrow {
    margin: 0 0 0.6rem;
    color: var(--sky-deep);
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.welcome__title {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 600;
    line-height: 1.25;
}

.welcome__lead {
    margin: 0.7rem 0 0;
    color: var(--ink-muted);
    font-size: 1rem;
}

@keyframes otp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

.login-foot {
    margin: 1.15rem 0 0;
    text-align: center;
}

[dir="rtl"] .art-panel {
    transform: rotateY(-9deg) rotateX(3deg);
    animation-name: art-float-rtl;
}

[dir="rtl"] .art-panel__slab {
    inset: 10px 10px -14px -10px;
}

[dir="rtl"] .login-brand__eyebrow,
[dir="rtl"] .login-brand__name {
    letter-spacing: 0;
    text-transform: none;
}

[dir="rtl"] .login-brand__name {
    font-family: var(--font-body);
}

@keyframes art-float {
    0%, 100% { transform: rotateY(9deg) rotateX(3deg) translateY(0); }
    50% { transform: rotateY(7deg) rotateX(2deg) translateY(-8px); }
}

@keyframes art-float-rtl {
    0%, 100% { transform: rotateY(-9deg) rotateX(3deg) translateY(0); }
    50% { transform: rotateY(-7deg) rotateX(2deg) translateY(-8px); }
}

@media (max-width: 860px) {
    .login-atelier {
        grid-template-columns: 1fr;
        max-width: 460px;
    }

    .art-panel,
    [dir="rtl"] .art-panel {
        width: min(100%, 320px);
        transform: rotateY(0deg) rotateX(2deg);
        animation: none;
    }

    .art-panel__caption {
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .art-panel {
        animation: none;
    }

    .login-submit {
        transition: none;
    }

    .otp__cells.is-shake,
    .welcome,
    .welcome__panel {
        animation: none;
        transition: none;
    }
}
