/* =============================================
   XDATA - Login & Register
   Loaded only by views/auth/login.php and register.php (after style.css)
   ============================================= */

.au {
    --au-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #db2777 100%);
    --au-ink: #0b1220;
    --au-muted: #64748b;
    --au-line: #e2e8f0;
    --au-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --au-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 100vh;
    margin: 0;
    background: #f6f7fb;
    color: var(--au-ink);
    overflow-x: hidden;
}

@keyframes auGradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes auFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes auBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -40px) scale(1.1); }
    66%      { transform: translate(-25px, 25px) scale(0.92); }
}
@keyframes auUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes auPop { from { opacity: 0; transform: scale(0.94) translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes auShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}
@keyframes auShine { from { transform: translateX(-130%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes auSpin { to { transform: rotate(360deg); } }
@keyframes auSlide { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.au-shell { display: grid; min-height: 100vh; }

/* ---------- Brand panel ---------- */
.au-brand {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    padding: 1.75rem 1.5rem 4.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #4f46e5 75%, #7c3aed 100%);
    background-size: 220% 220%;
    animation: auGradient 14s ease infinite;
}
.au-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 20%, transparent 75%);
}
.au-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    z-index: -1;
    animation: auBlob 16s ease-in-out infinite;
}
.au-orb.o1 { width: 340px; height: 340px; background: #3b82f6; top: -120px; left: -100px; }
.au-orb.o2 { width: 300px; height: 300px; background: #db2777; bottom: -140px; right: -80px; animation-delay: -6s; opacity: 0.4; }
.au-orb.o3 { width: 220px; height: 220px; background: #8b5cf6; top: 40%; left: 45%; animation-delay: -11s; opacity: 0.35; }
.au-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}
.au-logo:hover { color: #fff; }
.au-logo i {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.au-brand-copy { display: none; }
.au-brand-mobile { margin-top: 1rem; font-size: 0.92rem; opacity: 0.85; animation: auUp 0.7s var(--au-ease) both; }
.au-brand h2 {
    color: #fff;
    font-size: clamp(2rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}
.au-brand h2 span {
    background: linear-gradient(90deg, #93c5fd, #f0abfc, #fda4af);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: auGradient 6s ease infinite;
}
.au-brand p.lead { opacity: 0.8; line-height: 1.7; max-width: 420px; }

/* Rotating feature slides */
.au-slides { position: relative; height: 92px; margin: 2rem 0 1.5rem; max-width: 420px; }
.au-slide {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.6s var(--au-ease), transform 0.6s var(--au-ease);
}
.au-slide.is-active { opacity: 1; transform: none; }
.au-slide .ic {
    width: 46px; height: 46px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: #fff;
    color: #4f46e5;
}
.au-slide b { display: block; font-size: 0.98rem; }
.au-slide span { font-size: 0.82rem; opacity: 0.78; }
.au-dots { display: flex; gap: 0.4rem; }
.au-dots button {
    width: 8px; height: 8px;
    padding: 0;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.35);
    transition: width 0.4s var(--au-ease), background 0.3s ease;
}
.au-dots button.is-active { width: 26px; background: #fff; }

.au-trust { display: flex; gap: 1.75rem; margin-top: 2.5rem; }
.au-trust strong { display: block; font-size: 1.4rem; font-weight: 800; }
.au-trust span { font-size: 0.78rem; opacity: 0.7; }

.au-float {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--au-ink);
    font-size: 0.74rem;
    box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}
.au-float b { display: block; font-size: 0.8rem; }
.au-float span { color: var(--au-muted); }
.au-float .ic {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.au-float.f1 { right: 8%; top: 16%; animation: auFloat 6s ease-in-out infinite; }
.au-float.f2 { right: 14%; bottom: 12%; animation: auFloat 7s ease-in-out -2s infinite; }

/* ---------- Form side ---------- */
.au-main {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 0 1rem 2.5rem;
    margin-top: -3rem;
}
.au-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 28px;
    padding: 2rem 1.5rem;
    border: 1px solid var(--au-line);
    box-shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.35);
    animation: auPop 0.7s var(--au-ease) both;
}
.au-card.is-wide { max-width: 520px; }
.au-card.shake { animation: auShake 0.5s ease both; }
.au-head { margin-bottom: 1.5rem; }
.au-head h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.3rem; color: var(--au-ink); }
.au-head p { color: var(--au-muted); font-size: 0.92rem; }
.au-card > *:not(.au-head) { animation: auSlide 0.55s var(--au-ease) both; }
.au-stagger > * { animation: auSlide 0.55s var(--au-ease) both; }
.au-stagger > *:nth-child(1) { animation-delay: 0.10s; }
.au-stagger > *:nth-child(2) { animation-delay: 0.16s; }
.au-stagger > *:nth-child(3) { animation-delay: 0.22s; }
.au-stagger > *:nth-child(4) { animation-delay: 0.28s; }
.au-stagger > *:nth-child(5) { animation-delay: 0.34s; }
.au-stagger > *:nth-child(6) { animation-delay: 0.40s; }
.au-stagger > *:nth-child(7) { animation-delay: 0.46s; }
.au-stagger > *:nth-child(n+8) { animation-delay: 0.52s; }

/* Alerts */
.au-alert {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    font-size: 0.87rem;
    margin-bottom: 1.1rem;
    animation: auSlide 0.45s var(--au-spring) both;
}
.au-alert i { margin-top: 2px; }
.au-alert.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.au-alert.ok  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Google */
.au-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--au-line);
    background: #fff;
    color: var(--au-ink);
    font-weight: 600;
    font-size: 0.93rem;
    transition: transform 0.3s var(--au-spring), box-shadow 0.3s ease, border-color 0.3s ease;
}
.au-google:hover { color: var(--au-ink); transform: translateY(-2px); border-color: #c7d2fe; box-shadow: 0 12px 26px -16px rgba(79, 70, 229, 0.6); }
.au-google svg { transition: transform 0.5s var(--au-spring); }
.au-google:hover svg { transform: rotate(-12deg) scale(1.1); }
.au-divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.3rem 0;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.au-divider::before, .au-divider::after { content: ''; flex: 1; height: 1px; background: var(--au-line); }

/* Floating-label fields */
.au-row { display: grid; gap: 0.9rem; }
.au-field { position: relative; margin-bottom: 0.9rem; }
.au-row .au-field { margin-bottom: 0; }
.au-row { margin-bottom: 0.9rem; }
.au-field input {
    width: 100%;
    height: 56px;
    padding: 1.35rem 2.9rem 0.45rem 2.85rem;
    border-radius: 14px;
    border: 1.5px solid var(--au-line);
    background: #f8fafc;
    font: inherit;
    font-size: 0.95rem;
    color: var(--au-ink);
    transition: border-color 0.25s ease, box-shadow 0.3s ease, background 0.25s ease;
}
.au-field input:hover { border-color: #cbd5e1; }
.au-field input:focus {
    outline: none;
    background: #fff;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.au-field label {
    position: absolute;
    left: 2.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.93rem;
    pointer-events: none;
    transition: top 0.25s var(--au-ease), font-size 0.25s var(--au-ease), color 0.25s ease, transform 0.25s var(--au-ease);
}
.au-field input:focus + label,
.au-field input:not(:placeholder-shown) + label {
    top: 0.95rem;
    transform: none;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #6366f1;
}
.au-field input:not(:focus):not(:placeholder-shown) + label { color: var(--au-muted); }
.au-field .au-ico {
    position: absolute;
    left: 1rem;
    top: 28px;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    transition: color 0.25s ease, transform 0.35s var(--au-spring);
}
.au-field:focus-within .au-ico { color: #6366f1; transform: translateY(-50%) scale(1.12); }
.au-eye {
    position: absolute;
    right: 0.5rem;
    top: 28px;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 0;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.au-eye:hover { color: #4f46e5; background: #eef2ff; }
.au-eye i { transition: transform 0.35s var(--au-spring); }
.au-eye:active i { transform: scale(0.8); }
.au-mark {
    position: absolute;
    right: 1rem;
    top: 28px;
    transform: translateY(-50%) scale(0);
    font-size: 0.9rem;
    transition: transform 0.35s var(--au-spring);
}
.au-field.has-eye .au-mark { right: 3.1rem; }
.au-field.is-valid input { border-color: #10b981; }
.au-field.is-valid .au-mark { transform: translateY(-50%) scale(1); color: #10b981; }
.au-field.is-invalid input { border-color: #ef4444; background: #fff; }
.au-field.is-invalid input:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14); }
.au-field.is-invalid .au-ico { color: #ef4444; }
.au-msg {
    display: block;
    font-size: 0.75rem;
    margin: 0.35rem 0 0 0.3rem;
    color: #ef4444;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}
.au-field.is-invalid .au-msg,
.au-msg.is-shown { max-height: 40px; opacity: 1; }
.au-msg.hint { color: #d97706; }

/* Password strength */
.au-strength { margin: -0.3rem 0 0.9rem; }
.au-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
.au-bars span {
    height: 5px;
    border-radius: 999px;
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
}
.au-bars span::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--c, #e2e8f0);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s var(--au-ease), background 0.3s ease;
}
.au-bars span.on::after { transform: scaleX(1); }
.au-strength-label { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--au-muted); margin-top: 0.35rem; }
.au-strength-label b { color: var(--c, var(--au-muted)); transition: color 0.3s ease; }
.au-rules { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; margin-top: 0.45rem; }
.au-rules li { font-size: 0.74rem; color: #94a3b8; display: flex; align-items: center; gap: 0.35rem; transition: color 0.3s ease; }
.au-rules li i { font-size: 0.7rem; transition: transform 0.35s var(--au-spring); }
.au-rules li.ok { color: #059669; }
.au-rules li.ok i { transform: scale(1.2); }

/* Extras */
.au-opts { display: flex; justify-content: flex-end; margin: -0.2rem 0 1.2rem; }
.au-opts a, .au-foot a { font-weight: 600; color: #4f46e5; }
.au-opts a:hover, .au-foot a:hover { color: #3730a3; }
.au-check {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--au-muted);
    margin: 0.2rem 0 1.25rem;
    cursor: pointer;
    user-select: none;
}
.au-check input { position: absolute; opacity: 0; pointer-events: none; }
.au-box {
    width: 20px; height: 20px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.65rem;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.3s var(--au-spring);
}
.au-box i { transform: scale(0); transition: transform 0.3s var(--au-spring); }
.au-check input:checked + .au-box { background: #4f46e5; border-color: #4f46e5; transform: scale(1.06); }
.au-check input:checked + .au-box i { transform: scale(1); }
.au-check input:focus-visible + .au-box { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); }
.au-check.is-invalid .au-box { border-color: #ef4444; animation: auShake 0.4s ease; }
.au-caps {
    display: none;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    color: #d97706;
    margin: 0.35rem 0 0 0.3rem;
}
.au-caps.show { display: flex; animation: auSlide 0.3s ease both; }

/* Submit */
.au-submit {
    position: relative;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--au-grad);
    background-size: 200% 200%;
    animation: auGradient 6s ease infinite;
    box-shadow: 0 16px 32px -14px rgba(79, 70, 229, 0.75);
    transition: transform 0.3s var(--au-spring), box-shadow 0.3s ease;
}
.au-submit::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 40%;
    z-index: -1;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: auShine 3.2s ease-in-out infinite;
}
.au-submit:hover { transform: translateY(-2px); box-shadow: 0 22px 38px -14px rgba(79, 70, 229, 0.85); }
.au-submit:active { transform: scale(0.98); }
.au-submit .spin {
    display: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: auSpin 0.7s linear infinite;
}
.au-submit.is-loading { pointer-events: none; }
.au-submit.is-loading .spin { display: block; }
.au-submit.is-loading .lbl { opacity: 0.85; }
.au-foot { text-align: center; margin-top: 1.4rem; font-size: 0.9rem; color: var(--au-muted); }
.au-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: #94a3b8;
}
.au-back:hover { color: #4f46e5; }
.au-back i { transition: transform 0.3s var(--au-spring); }
.au-back:hover i { transform: translateX(-3px); }
.au-secure { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-top: 1.1rem; font-size: 0.75rem; color: #94a3b8; }
.au-secure i { color: #10b981; }

/* ---------- Layout breakpoints ---------- */
@media (min-width: 520px) {
    .au-card { padding: 2.4rem 2.25rem; }
    .au-row.two { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
    .au-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .au-brand {
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 2.5rem 3rem;
        display: flex;
        flex-direction: column;
    }
    .au-brand-mobile { display: none; }
    .au-brand-copy { display: block; margin: auto 0; animation: auUp 0.9s var(--au-ease) 0.1s both; }
    .au-main { margin-top: 0; align-items: center; padding: 3rem 2rem; }
    .au-card { box-shadow: 0 30px 70px -40px rgba(15, 23, 42, 0.35); }
}
@media (max-width: 959px) {
    .au-float { display: none; }
}

/* ---------- Accessibility ---------- */
.au a:focus-visible, .au button:focus-visible { outline: 2px solid #6366f1; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    .au *, .au *::before, .au *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
