/* =========================================================
   منصة سريع — ثيم صفحات الحساب (دخول / تسجيل)
   ملف واحد مشترك بين login و register
   ========================================================= */

:root {
    --plum-900: #221545;
    --plum-700: #3a2377;
    --violet: #7c5cff;
    --violet-dark: #6141e0;
    --amber: #f97316;
    --amber-dark: #e05e0c;
    --ink: #241f38;
    --muted: #736d8a;
    --line: #e8e4f2;
    --field: #faf9fe;
    --danger: #c0324a;
}

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

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

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(circle at top right, rgba(236, 72, 153, .28), transparent 36%),
        radial-gradient(circle at bottom left, rgba(56, 189, 248, .20), transparent 42%),
        linear-gradient(135deg, #1a1036 0%, #35216f 50%, #7c5cff 100%);
}

a {
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- التخطيط ---------- */

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    overflow: hidden;
}

.auth-wrap {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 470px;
}

.auth-wrap--wide {
    max-width: 620px;
}

/* ---------- الهوية ---------- */

.brand {
    display: block;
    color: #fff;
}

.brand__logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 24px;
    object-fit: contain;
}

/* ---------- الكرت ---------- */

.auth-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 26px;
    background: #fff;
    box-shadow:
        0 2px 6px rgba(26, 16, 54, .06),
        0 18px 40px rgba(26, 16, 54, .20),
        0 40px 90px rgba(26, 16, 54, .24);
}

.auth-card__header {
    padding: 30px 32px 26px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(circle at 82% 12%, rgba(255, 255, 255, .18), transparent 45%),
        linear-gradient(135deg, var(--plum-900) 0%, var(--plum-700) 52%, var(--violet) 130%);
}

.auth-card__header h1 {
    margin: 0 0 7px;
    color: #fff;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.auth-card__header p {
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: .87rem;
}

.auth-card__body {
    padding: 28px 32px 30px;
}

/* ---------- التنبيهات ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #f6ccd0;
    border-radius: 13px;
    background: #fdf2f3;
    color: #a3263a;
    font-size: .84rem;
    line-height: 1.7;
}

.alert svg {
    flex: none;
    width: 17px;
    height: 17px;
    margin-top: 3px;
    fill: currentColor;
}

.alert ul {
    margin: 0;
    padding-inline-start: 18px;
}

.alert--success {
    border-color: #bfe7cf;
    background: #f1fbf5;
    color: #16643c;
}

/* ---------- الحقول ---------- */

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

label {
    color: #322b4d;
    font-size: .81rem;
    font-weight: 700;
}

.req {
    color: var(--danger);
    margin-inline-start: 3px;
}

.link-muted {
    color: var(--violet-dark);
    font-size: .78rem;
    font-weight: 600;
}

.link-muted:hover {
    color: #4e33c4;
}

.control {
    position: relative;
}

.control__icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 15px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: #a49dbb;
    pointer-events: none;
    transition: fill .2s ease;
}

.form-control {
    display: block;
    width: 100%;
    height: 50px;
    padding-block: 10px;
    padding-inline: 45px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--field);
    color: var(--ink);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.form-control::placeholder {
    color: #aea7c2;
}

.form-control:focus {
    border-color: var(--violet);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .13);
    outline: none;
}

.form-control.is-invalid {
    border-color: #eba7b3;
    background: #fef6f7;
}

.control__icon:has(+ .form-control:focus) {
    fill: var(--violet);
}

.control--password .form-control {
    padding-inline-end: 48px;
}

.field-error {
    margin: 6px 2px 0;
    color: var(--danger);
    font-size: .76rem;
    font-weight: 600;
}

.toggle-password {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8f88a6;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}

.toggle-password:hover {
    color: var(--ink);
    background: #f1eefb;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

/* مؤشّر قوة كلمة السر */

.strength {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 2px 0;
}

.strength__bar {
    flex: 1;
    height: 5px;
    border-radius: 99px;
    background: #ece8f7;
    overflow: hidden;
}

.strength__fill {
    width: 0;
    height: 100%;
    border-radius: 99px;
    background: var(--danger);
    transition: width .25s ease, background .25s ease;
}

.strength__label {
    min-width: 52px;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    text-align: start;
}

/* خانات الاختيار */

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 20px;
    color: #5d5677;
    font-size: .82rem;
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 17px;
    height: 17px;
    margin: 0;
    flex: none;
    accent-color: var(--violet);
    cursor: pointer;
}

.check a {
    color: var(--violet-dark);
    font-weight: 700;
}

/* كلمة التحقق */

.captcha {
    display: flex;
    gap: 10px;
}

.captcha__question {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f2eefc;
    color: #4a3f70;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .04em;
    user-select: none;
}

.captcha .control {
    flex: 1;
}

.captcha .form-control {
    padding-inline-start: 16px;
}

/* حقل فخ السبام — لازم يضل مخفي */
.hp-field {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- الأزرار ---------- */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 51px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-family: inherit;
    font-size: .93rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.btn:active {
    transform: translateY(0) scale(.994);
}

.btn svg {
    flex: none;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--amber), #fb923c);
    box-shadow: 0 8px 20px rgba(249, 115, 22, .3);
    font-weight: 800;
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--amber-dark), #f4842a);
    box-shadow: 0 12px 26px rgba(249, 115, 22, .38);
    transform: translateY(-1px);
}

.btn--primary[disabled] {
    opacity: .8;
    cursor: progress;
    transform: none;
}

.btn--facebook {
    color: #fff;
    background: #1877f2;
    box-shadow: 0 8px 18px rgba(24, 119, 242, .24);
}

.btn--facebook:hover {
    background: #1266d6;
    box-shadow: 0 12px 24px rgba(24, 119, 242, .32);
    transform: translateY(-1px);
}

/* فيسبوك + انستجرام في سطر واحد بنفس المقاس؛ زرار واحد = العرض كله. تحت بعض على الموبايل (آخر الملف) */
.social-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 10px;
}

.btn--instagram {
    color: #fff;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 8px 18px rgba(220, 39, 67, .24);
}

.btn--instagram:hover {
    background: linear-gradient(45deg, #e5852a 0%, #d85d33 25%, #cc2039 50%, #bb1d5c 75%, #a8157a 100%);
    box-shadow: 0 12px 24px rgba(220, 39, 67, .32);
    transform: translateY(-1px);
}

.btn--google {
    margin-top: 10px;
    border-color: var(--line);
    color: #313847;
    background: #fff;
}

.btn--google:hover {
    border-color: #d8d1ea;
    background: #faf9fe;
    transform: translateY(-1px);
}

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

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

/* ---------- فواصل ونصوص ---------- */

.divider {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 24px 0 18px;
    color: #a09ab4;
    font-size: .78rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.hint {
    margin: 0 0 12px;
    color: var(--muted);
    text-align: center;
    font-size: .81rem;
}

.foot-note {
    margin: 20px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: .82rem;
}

.foot-note a {
    color: var(--violet-dark);
    font-weight: 700;
}

/* ---------- الخلفية ---------- */

.floating-icon {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    pointer-events: none;
    filter: blur(.4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    animation-name: drift;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.floating-icon svg {
    width: 44%;
    height: 44%;
    fill: currentColor;
}

.floating-icon.like {
    background: linear-gradient(145deg, #38bdf8, #0e7fc4);
}

.floating-icon.love {
    background: linear-gradient(145deg, #f472b6, #db2777);
}

.floating-icon.whatsapp {
    background: linear-gradient(145deg, #34d399, #0f9d6b);
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0) rotate(-7deg) scale(1);
    }

    50% {
        transform: translate3d(26px, -34px, 0) rotate(7deg) scale(1.07);
    }

    100% {
        transform: translate3d(-18px, 30px, 0) rotate(-4deg) scale(.95);
    }
}

.i-1 { top: 8%; left: 8%; width: 58px; height: 58px; opacity: .3; animation-duration: 9s; }
.i-2 { top: 22%; left: 17%; width: 38px; height: 38px; opacity: .2; animation-duration: 12s; animation-delay: -3s; }
.i-3 { top: 10%; right: 10%; width: 72px; height: 72px; opacity: .3; animation-duration: 10s; animation-delay: -2s; }
.i-4 { top: 34%; right: 13%; width: 42px; height: 42px; opacity: .19; animation-duration: 13s; animation-delay: -6s; }
.i-5 { bottom: 10%; left: 10%; width: 76px; height: 76px; opacity: .29; animation-duration: 11s; animation-delay: -4s; }
.i-6 { bottom: 26%; left: 21%; width: 44px; height: 44px; opacity: .18; animation-duration: 14s; animation-delay: -8s; }
.i-7 { right: 9%; bottom: 11%; width: 64px; height: 64px; opacity: .28; animation-duration: 10.5s; animation-delay: -1s; }
.i-8 { right: 22%; bottom: 28%; width: 36px; height: 36px; opacity: .19; animation-duration: 12.5s; animation-delay: -5s; }
.i-9 { top: 53%; left: 6%; width: 34px; height: 34px; opacity: .18; animation-duration: 13.5s; animation-delay: -7s; }
.i-10 { top: 56%; right: 6%; width: 50px; height: 50px; opacity: .21; animation-duration: 11.5s; animation-delay: -2.5s; }

.bg-circle {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    pointer-events: none;
}

.bg-circle--one {
    top: -180px;
    left: -120px;
    width: 380px;
    height: 380px;
}

.bg-circle--two {
    right: -230px;
    bottom: -220px;
    width: 500px;
    height: 500px;
}

/* ---------- الاستجابة ---------- */

@media (min-width: 560px) {
    .form-grid--two {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

    .floating-icon,
    .spinner {
        animation: none;
    }

    .btn,
    .form-control {
        transition: none;
    }
}

@media (max-width: 768px) {
    .auth-page {
        padding: 28px 14px;
    }

    .brand__logo {
        max-width: 160px;
    }

    .auth-card {
        border-radius: 22px;
    }

    .auth-card__header {
        padding: 24px 22px 20px;
    }

    .auth-card__header h1 {
        font-size: 1.22rem;
    }

    .auth-card__body {
        padding: 24px 22px 26px;
    }

    .i-1 { top: 5%; left: -14px; width: 46px; height: 46px; }
    .i-2, .i-6, .i-8, .i-9 { display: none; }
    .i-3 { top: 11%; right: -16px; width: 52px; height: 52px; }
    .i-4 { top: 30%; right: -12px; width: 40px; height: 40px; }
    .i-5 { bottom: 8%; left: -16px; width: 56px; height: 56px; }
    .i-7 { right: -14px; bottom: 12%; width: 50px; height: 50px; }
    .i-10 { top: 58%; right: -12px; width: 42px; height: 42px; }
}

@media (max-width: 480px) {
    .social-row {
        grid-auto-flow: row;
    }
}
