/*
 * Sign-in screens (resources/views/auth/_partials): the "الشرارة" scene fills
 * the page and the form floats on it in a card. The scene keeps the brand
 * colours in both themes; the card follows the light/dark tokens.
 */
.fx-auth {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(2rem, 7vw, 7rem);
    padding: 2.5rem 1.25rem 3.5rem;
    background: #4a0828;
    color: #fff;
}

/* Background: three blurred glows drifting over a fine dot grid */
.fx-auth-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.fx-auth-blob { position: absolute; border-radius: 50%; filter: blur(80px); }
.fx-auth-blob--1 { width: 34rem; height: 34rem; top: -10rem; right: -6rem; background: #de1e38; opacity: .5; animation: fx-auth-drift-1 18s ease-in-out infinite alternate; }
.fx-auth-blob--2 { width: 42rem; height: 42rem; bottom: -16rem; left: -10rem; background: #a81d3e; opacity: .6; animation: fx-auth-drift-2 22s ease-in-out infinite alternate; }
.fx-auth-blob--3 { width: 28rem; height: 28rem; top: 38%; left: 34%; background: #0d123a; opacity: .5; animation: fx-auth-drift-3 20s ease-in-out infinite alternate; }
.fx-auth-dots {
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image: radial-gradient(rgba(255, 255, 255, .6) 1px, transparent 1.2px);
    background-size: 22px 22px;
}

/* Brand side (large screens only) */
.fx-auth-brand { display: none; }
.fx-auth-mark { width: 8.5rem; height: auto; overflow: visible; margin-bottom: 1.75rem; }
.fx-auth-chevron {
    stroke: #fff;
    stroke-width: .45;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    fill-opacity: 0;
    animation: fx-auth-draw 8s ease-in-out infinite;
}
.fx-auth-chevron--2 { animation-delay: .25s; }
.fx-auth-ray { transform-box: fill-box; transform-origin: center; opacity: 0; animation: fx-auth-pop 8s ease-out infinite; }
.fx-auth-ray--2 { animation-delay: .12s; }
.fx-auth-ray--3 { animation-delay: .24s; }
.fx-auth-ray--4 { animation-delay: .36s; }
.fx-auth-ray--5 { animation-delay: .48s; }
.fx-auth-kicker { margin: 0 0 .5rem; font-size: .95rem; color: rgba(255, 255, 255, .75); }
.fx-auth-title { margin: 0; font-size: clamp(1.9rem, 2.7vw, 2.4rem); font-weight: 800; line-height: 1.3; color: #fff; text-wrap: balance; }
.fx-auth-lead { margin: .85rem 0 0; max-width: 28rem; font-size: 1.05rem; line-height: 1.9; color: rgba(255, 255, 255, .82); }
.fx-auth-notes { position: relative; width: 100%; max-width: 24rem; height: 4.9rem; margin-top: 2rem; }
.fx-auth-note {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, .1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
    backdrop-filter: blur(12px);
    opacity: 0;
    animation: fx-auth-cycle 9s ease-in-out infinite;
}
.fx-auth-note--2 { animation-delay: 3s; }
.fx-auth-note--3 { animation-delay: 6s; }
.fx-auth-note-icon { width: 2.75rem; height: 2.75rem; flex: none; border-radius: .9rem; display: grid; place-items: center; font-size: 1.3rem; }
.fx-auth-note-icon--ok { background: rgba(52, 195, 143, .22); color: #8ff0c6; }
.fx-auth-note-icon--info { background: rgba(138, 164, 234, .25); color: #c7d4ff; }
.fx-auth-note-icon--spark { background: rgba(255, 138, 157, .25); color: #ffc2cd; }
.fx-auth-note-text b { display: block; font-size: .95rem; }
.fx-auth-note-text small { display: block; font-size: .8rem; color: rgba(255, 255, 255, .75); }
.fx-auth-note-time { margin-inline-start: auto; align-self: flex-start; font-size: .75rem; color: rgba(255, 255, 255, .7); }
.fx-auth-foot { position: absolute; bottom: 1.1rem; left: 0; right: 0; margin: 0; text-align: center; font-size: .8rem; color: rgba(255, 255, 255, .6); }

/* Form card */
.fx-auth-form { width: min(28rem, 100%); }
.fx-auth-card {
    border-radius: 1.75rem;
    padding: 2.5rem 2.5rem 2rem;
    background: var(--fx-surface);
    color: var(--fx-text);
    box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .65);
    animation: fx-auth-up .8s cubic-bezier(.2, .8, .2, 1) both;
}
.fx-auth-card .card { margin: 0; border: 0; box-shadow: none; background: transparent; }
.fx-auth-card .card-body { padding: 0; }
.fx-auth-card .app-brand img { max-width: 9rem; height: auto; }
.fx-auth-card .app-brand-text { display: none; }
.fx-auth-card h4 { font-weight: 700; color: var(--fx-heading); }
.fx-auth-card .form-control { height: 2.875rem; border-radius: .75rem; }
.fx-auth-card .input-group-merge .input-group-text { border-radius: .75rem 0 0 .75rem; }
.fx-auth-card .btn[type="submit"] { height: 2.875rem; border-radius: .75rem; font-weight: 700; }

/* Login form */
.fx-login-brand { display: inline-block; margin-bottom: 1.75rem; }
.fx-login-logo { display: block; width: 8.5rem; height: auto; }
.fx-login-logo--dark,
.dark-style .fx-login-logo--light { display: none; }
.dark-style .fx-login-logo--dark { display: block; }
.fx-login-title { margin: 0; font-size: 1.75rem; font-weight: 700; color: var(--fx-heading); }
.fx-login-sub { margin: .35rem 0 1.5rem; font-size: .95rem; color: var(--fx-muted); }
.fx-login { display: flex; flex-direction: column; gap: 1rem; }

/* Field with a label that floats up on focus or once it has a value */
.fx-field { position: relative; }
.fx-field input {
    width: 100%;
    height: 3.6rem;
    padding: 1.25rem 2.9rem .3rem 1rem;
    border: 1px solid var(--fx-border);
    border-radius: .95rem;
    background: var(--fx-surface);
    color: var(--fx-heading);
    font-size: 1rem;
    outline: 0;
    transition: border-color .2s, box-shadow .2s;
}
.fx-field--password input { padding-left: 3.25rem; }
.fx-field input:focus { border-color: var(--fx-crimson); box-shadow: 0 0 0 4px var(--fx-ring); }
.fx-field label {
    position: absolute;
    top: 1.15rem;
    right: 2.9rem;
    font-size: .92rem;
    color: var(--fx-muted);
    pointer-events: none;
    transform-origin: top right;
    transition: transform .18s ease, color .18s ease;
}
.fx-field input:focus + label,
.fx-field input:not(:placeholder-shown) + label,
.fx-field input:-webkit-autofill + label { transform: translateY(-.72rem) scale(.8); color: var(--fx-crimson); }
.fx-field-icon { position: absolute; top: 1.15rem; right: 1rem; font-size: 1.25rem; color: var(--fx-muted); transition: color .2s; }
.fx-field input:focus ~ .fx-field-icon { color: var(--fx-crimson); }
.fx-field-toggle {
    position: absolute;
    top: .65rem;
    left: .55rem;
    width: 2.3rem;
    height: 2.3rem;
    border: 0;
    border-radius: .7rem;
    background: transparent;
    color: var(--fx-muted);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    cursor: pointer;
}
.fx-field-toggle:hover { background: var(--fx-surface-2); color: var(--fx-heading); }
.fx-field.is-invalid input { border-color: var(--fx-danger); }
.fx-field.is-invalid input:focus { box-shadow: 0 0 0 4px var(--fx-danger-soft); }
.fx-field.is-invalid label,
.fx-field.is-invalid .fx-field-icon { color: var(--fx-danger); }
.fx-field-error { margin: -.55rem 0 0; font-size: .82rem; font-weight: 600; color: var(--fx-danger); }

.fx-login-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; font-size: .9rem; color: var(--fx-muted); }
.fx-login-row a { font-weight: 600; }
.fx-check { display: inline-flex; align-items: center; gap: .5rem; margin: 0; cursor: pointer; }
.fx-check .form-check-input { float: none; margin: 0; }
.fx-login-submit {
    height: 3.4rem;
    margin-top: .25rem;
    border: 0;
    border-radius: .95rem;
    background: linear-gradient(90deg, var(--fx-primary), #8c1a4c);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    box-shadow: 0 18px 30px -18px rgba(111, 15, 61, .8);
    transition: transform .2s, box-shadow .2s;
}
.fx-login-submit:hover { transform: translateY(-2px); box-shadow: 0 22px 34px -18px rgba(111, 15, 61, .9); }
.fx-login-submit .ti { font-size: 1.15rem; transition: transform .2s; }
.fx-login-submit:hover .ti { transform: translateX(-4px); }

@media (min-width: 992px) {
    .fx-auth-form { order: 1; }
    .fx-auth-brand { order: 2; flex: 0 1 34rem; display: flex; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 575.98px) {
    .fx-auth-card { padding: 2rem 1.35rem 1.6rem; border-radius: 1.4rem; }
}

@keyframes fx-auth-draw {
    0% { stroke-dashoffset: 60; fill-opacity: 0; }
    30% { stroke-dashoffset: 0; fill-opacity: 0; }
    42% { fill-opacity: 1; }
    88% { stroke-dashoffset: 0; fill-opacity: 1; }
    96% { stroke-dashoffset: 0; fill-opacity: 0; }
    100% { stroke-dashoffset: 60; fill-opacity: 0; }
}
@keyframes fx-auth-pop {
    0%, 32% { opacity: 0; transform: scale(.3); }
    40% { opacity: 1; transform: scale(1.2); }
    46% { transform: scale(1); }
    88% { opacity: 1; transform: scale(1); }
    96%, 100% { opacity: 0; transform: scale(.6); }
}
@keyframes fx-auth-cycle {
    0% { opacity: 0; transform: translateY(16px); }
    5%, 30% { opacity: 1; transform: translateY(0); }
    36%, 100% { opacity: 0; transform: translateY(-14px); }
}
@keyframes fx-auth-drift-1 { to { transform: translate(-120px, 140px) scale(1.15); } }
@keyframes fx-auth-drift-2 { to { transform: translate(160px, -90px) scale(.9); } }
@keyframes fx-auth-drift-3 { to { transform: translate(-90px, -120px) scale(1.2); } }
@keyframes fx-auth-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .fx-auth-blob,
    .fx-auth-chevron,
    .fx-auth-ray,
    .fx-auth-note,
    .fx-auth-card { animation: none; }
    .fx-auth-chevron { stroke-dashoffset: 0; fill-opacity: 1; }
    .fx-auth-ray { opacity: 1; }
    .fx-auth-note:first-child { opacity: 1; }
}
