/* ============================================================
   Auth Pages Redesign v2 - modern, creative (LTR & RTL)
   Brand: #667eea -> #764ba2, accent #4361ee
   ============================================================ */

:root {
    --auth-brand-1: #667eea;
    --auth-brand-2: #764ba2;
    --auth-accent: #4361ee;
    --auth-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --auth-gradient-soft: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.12));
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #e2e8f0;
    --auth-surface: #ffffff;
    --auth-bg: #f5f7fb;
}

.auth-page {
    background:
        radial-gradient(900px 500px at 12% 8%, rgba(118,75,162,0.45), transparent 62%),
        radial-gradient(800px 480px at 88% 92%, rgba(102,126,234,0.4), transparent 62%),
        linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4338ca 100%);
    min-height: 100vh;
    font-family: var(--app-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* floating blobs */
.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
    animation: authFloat 14s ease-in-out infinite;
}
.auth-page::before {
    width: 340px; height: 340px;
    background: #a78bfa;
    top: -80px; inset-inline-start: -60px;
}
.auth-page::after {
    width: 280px; height: 280px;
    background: #60a5fa;
    bottom: -60px; inset-inline-end: -40px;
    animation-delay: -6s;
}
@keyframes authFloat {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(20px, -30px) scale(1.08); }
}

.auth-shell { position: relative; z-index: 1; }
.auth-container-width { max-width: 480px; width: 100%; margin-block: auto; }
.auth-container-width.auth-container-wide { max-width: 760px; }
@media (min-width: 1200px) { .auth-container-width.auth-container-wide { max-width: 880px; } }
@media (max-width: 768px) { .auth-container-width.auth-container-wide { max-width: 100%; } }

/* brand */
.auth-brand {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
    text-shadow: 0 6px 18px rgba(0,0,0,0.3);
    display: inline-flex; align-items: center; gap: 0.6rem;
    transition: transform .25s ease, text-shadow .25s ease;
}
.auth-brand:hover { color: #fff; transform: translateY(-2px); text-shadow: 0 8px 22px rgba(0,0,0,0.35); text-decoration: none; }
.auth-brand img { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }

/* card */
.auth-card {
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 1.6rem;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    box-shadow: 0 30px 70px rgba(15,23,42,0.35), 0 8px 24px rgba(15,23,42,0.18);
    overflow: hidden;
    position: relative;
}
.auth-card::before {
    content: "";
    position: absolute;
    inset-block-start: 0; inset-inline: 0;
    height: 4px;
    background: var(--auth-gradient);
}
.auth-card .card-body { padding: 2rem 2.1rem; position: relative; z-index: 1; }
@media (max-width: 576px) { .auth-card .card-body { padding: 1.6rem 1.25rem; } }

/* avatar / icon badge */
.auth-avatar {
    width: 68px; height: 68px;
    border-radius: 1.2rem;
    background: var(--auth-gradient);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 14px 30px rgba(102,126,234,0.45);
    color: #fff; font-size: 1.5rem;
    transform: rotate(-6deg);
    transition: transform .3s ease;
}
.auth-avatar:hover { transform: rotate(0deg) scale(1.05); }

.auth-title { font-weight: 800; color: var(--auth-ink); letter-spacing: -0.4px; font-size: 1.5rem; }
.auth-subtitle { color: var(--auth-muted); font-size: 0.92rem; line-height: 1.5; }

/* form */
.auth-form .form-label { font-weight: 600; font-size: 0.8rem; color: #334155; margin-bottom: 0.4rem; letter-spacing: 0.02em; }
.auth-form .input-group {
    border-radius: 0.9rem; overflow: hidden;
    border: 1.5px solid var(--auth-line);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    background: #fff;
}
.auth-form .input-group:focus-within {
    border-color: var(--auth-brand-1);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.18);
    transform: translateY(-1px);
}
.auth-form .input-group-text {
    background: #f8fafc; border: 0; color: #94a3b8;
    padding-inline: 0.95rem; font-size: 0.95rem;
}
.auth-form .form-control {
    border: 0; padding: 0.72rem 0.95rem; font-size: 0.95rem;
    background: transparent; color: var(--auth-ink);
}
.auth-form .form-control::placeholder { color: #cbd5e1; }
.auth-form .form-control:focus { box-shadow: none; }
.auth-form .toggle-password,
.auth-form .check-username-btn {
    border: 0; background: #f8fafc; color: #64748b;
    border-inline-start: 1.5px solid var(--auth-line);
    padding-inline: 0.9rem; transition: background .2s, color .2s;
}
.auth-form .toggle-password:hover,
.auth-form .check-username-btn:hover { background: #eef2ff; color: var(--auth-brand-1); }

/* buttons */
.auth-btn-primary,
.auth-btn-outline {
    text-decoration: none !important;
}
.auth-btn-primary {
    background: var(--auth-gradient);
    border: 0; border-radius: 0.9rem;
    padding: 0.82rem 1rem; font-weight: 700; font-size: 0.96rem;
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(102,126,234,0.38);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    position: relative; overflow: hidden;
}
.auth-btn-primary::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .6s ease;
}
.auth-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(102,126,234,0.45); filter: brightness(1.05); color: #fff !important; text-decoration: none !important; }
.auth-btn-primary:hover::after { transform: translateX(100%); }
.auth-btn-primary:active { transform: translateY(0); }
.auth-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.auth-btn-outline {
    border: 1.5px solid var(--auth-brand-1); border-radius: 0.9rem;
    padding: 0.78rem 1rem; font-weight: 600; color: var(--auth-brand-1);
    background: #fff; transition: all .2s ease;
}
.auth-btn-outline:hover { background: var(--auth-gradient); color: #fff !important; border-color: transparent; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(102,126,234,0.3); text-decoration: none !important; }

/* divider */
.auth-divider { position: relative; text-align: center; margin: 1.3rem 0; }
.auth-divider::before { content: ""; position: absolute; inset-inline: 0; top: 50%; border-top: 1px solid var(--auth-line); }
.auth-divider span { position: relative; background: #fff; padding: 0 0.9rem; color: #94a3b8; font-size: 0.78rem; font-weight: 600; }

/* links */
.auth-link { color: var(--auth-brand-1); font-weight: 600; text-decoration: none !important; transition: color .2s; }
.auth-link:hover { color: var(--auth-brand-2); text-decoration: none !important; }

/* no underlines on any link inside auth pages */
.auth-page a { text-decoration: none !important; }
.auth-page a:hover { text-decoration: none !important; }
.auth-page a:focus { text-decoration: none !important; }
.auth-page .btn,
.auth-page .btn:hover,
.auth-page .btn:focus { text-decoration: none !important; }

.auth-footer-link { color: rgba(255,255,255,0.75); font-size: 0.85rem; text-decoration: none; transition: color .2s; }
.auth-footer-link:hover { color: #fff; text-decoration: none; }

/* role cards */
.role-card {
    border: 1.5px solid var(--auth-line); border-radius: 1.1rem;
    padding: 1rem 0.5rem; background: #fff;
    transition: all .25s ease; cursor: pointer; text-align: center;
}
.role-card:hover { border-color: var(--auth-brand-1); background: #f5f3ff; transform: translateY(-3px); box-shadow: 0 10px 24px rgba(102,126,234,0.15); }
.btn-check:checked + .role-card {
    border-color: var(--auth-brand-1);
    background: var(--auth-gradient-soft);
    box-shadow: 0 8px 20px rgba(102,126,234,0.2);
}
.role-card i { transition: transform .25s ease; }
.role-card:hover i { transform: scale(1.1); }

/* progress / strength */
.auth-progress { height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.auth-progress .progress-bar { transition: width .35s ease, background-color .35s ease; border-radius: 999px; }

.auth-requirements {
    background: #f8fafc; border: 1px solid var(--auth-line);
    border-radius: 0.85rem; padding: 0.8rem; font-size: 0.78rem; color: var(--auth-muted);
}

.invalid-feedback { font-size: 0.75rem; color: #dc2626; margin-top: 0.35rem; }

/* misc */
.auth-card .alert { border-radius: 0.85rem; }

@media (max-width: 480px) {
    .auth-brand { font-size: 1.45rem; }
    .auth-avatar { width: 58px; height: 58px; font-size: 1.25rem; }
    .auth-title { font-size: 1.3rem; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-page::before, .auth-page::after { animation: none; }
}
