/* =========================================================
   BizPilotAI — Auth Pages
   Animated gradient + floating balloons + orbs + glass card
   ========================================================= */

:root {
    --auth-bg-1: #0f0c29;
    --auth-bg-2: #302b63;
    --auth-bg-3: #24243e;
    --auth-text: #e9ecf5;
    --auth-muted: #a3aac4;
    --auth-primary: #6a5cff;
    --auth-primary-2: #8b7bff;
    --auth-accent: #4facfe;
    --auth-border: rgba(255,255,255,0.10);
    --auth-border-strong: rgba(255,255,255,0.18);
    --auth-card: rgba(20, 22, 40, 0.55);
    --auth-error: #ff6b81;
    --auth-success: #43e97b;
    --auth-radius: 16px;
    --auth-radius-sm: 10px;
}

/* ----- Page shell ----- */

html, body.auth-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--auth-text);
    background: var(--auth-bg-1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ----- Animated background ----- */

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 50%, var(--auth-bg-3) 100%);
    background-size: 200% 200%;
    animation: authGradient 22s ease-in-out infinite;
}

@keyframes authGradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.auth-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    pointer-events: none;
}

/* Floating orbs */
.auth-bg__orbs { position: absolute; inset: 0; }

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    will-change: transform;
    pointer-events: none;
}

.orb--1 {
    width: 380px; height: 380px;
    background: radial-gradient(circle at 30% 30%, #6a5cff, transparent 70%);
    top: -80px; left: -60px;
    animation: floatOrb1 18s ease-in-out infinite;
}
.orb--2 {
    width: 320px; height: 320px;
    background: radial-gradient(circle at 30% 30%, #4facfe, transparent 70%);
    bottom: -100px; right: -60px;
    animation: floatOrb2 24s ease-in-out infinite;
}
.orb--3 {
    width: 260px; height: 260px;
    background: radial-gradient(circle at 30% 30%, #f093fb, transparent 70%);
    top: 45%; left: 55%;
    opacity: 0.35;
    animation: floatOrb3 21s ease-in-out infinite;
}
.orb--4 {
    width: 220px; height: 220px;
    background: radial-gradient(circle at 30% 30%, #43e97b, transparent 70%);
    top: 70%; left: 15%;
    opacity: 0.30;
    animation: floatOrb4 26s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(60px,40px,0) scale(1.1); }
}
@keyframes floatOrb2 {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(-70px,-40px,0) scale(1.08); }
}
@keyframes floatOrb3 {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(40px,-50px,0) scale(1.15); }
}
@keyframes floatOrb4 {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(-40px,60px,0) scale(1.1); }
}

/* Balloons */
.auth-bg__balloons { position: absolute; inset: 0; }

.balloon {
    position: absolute;
    bottom: -160px;
    left: var(--x, 10%);
    width: calc(46px * var(--s, 1));
    height: calc(58px * var(--s, 1));
    background:
        radial-gradient(circle at 32% 28%, rgba(255,255,255,0.45), transparent 45%),
        var(--c, #f5576c);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    will-change: transform;
    animation: balloonRise var(--d, 30s) linear infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.25));
}

.balloon::after {
    /* Balloon knot */
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--c, #f5576c);
    filter: brightness(0.85);
}

.balloon::before {
    /* String */
    content: "";
    position: absolute;
    bottom: -14px;
    left: 50%;
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,0.35);
    transform: translateX(-50%);
}

@keyframes balloonRise {
    0%   { transform: translate3d(0, 0, 0) rotate(-4deg);   opacity: 0; }
    8%   { opacity: 0.75; }
    50%  { transform: translate3d(20px, -60vh, 0) rotate(3deg); }
    92%  { opacity: 0.75; }
    100% { transform: translate3d(-10px, -125vh, 0) rotate(-3deg); opacity: 0; }
}

/* ----- Shell & brand ----- */

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 24px;
    gap: 16px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--auth-text);
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}
.auth-brand:hover { transform: translateY(-1px); color: #fff; }

.auth-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 8px 24px rgba(106,92,255,0.45);
}
.auth-brand__name { font-size: 1.1rem; letter-spacing: 0.3px; }

/* ----- Cards ----- */

.auth-card {
    position: relative;
    width: 100%;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border-radius: var(--auth-radius);
    box-shadow:
        0 30px 80px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.06);
    padding: 32px;
    animation: authCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card--narrow { max-width: 440px; }
.auth-card--wide {
    max-width: 980px;
    padding: 0;
    display: grid;
    grid-template-columns: 380px 1fr;
    overflow: hidden;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0)     scale(1); }
}

.auth-card__head { text-align: center; margin-bottom: 22px; }
.auth-card__head--left { text-align: left; }

.auth-card__title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.auth-card__subtitle {
    color: var(--auth-muted);
    font-size: 0.94rem;
    margin: 0;
}

/* ----- Left side panel (register) ----- */

.auth-side {
    position: relative;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(106,92,255,0.35), transparent 60%),
        radial-gradient(120% 80% at 100% 100%, rgba(79,172,254,0.30), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border-right: 1px solid var(--auth-border);
    padding: 36px 30px;
    display: flex;
    align-items: center;
}

.auth-side__inner { width: 100%; }

.auth-side__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(106,92,255,0.15);
    color: #dcd6ff;
    border: 1px solid rgba(106,92,255,0.35);
    margin-bottom: 18px;
}

.auth-side__title {
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}
.auth-side__title span {
    background: linear-gradient(90deg, var(--auth-primary-2), var(--auth-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-side__lead {
    color: var(--auth-muted);
    font-size: 0.92rem;
    margin-bottom: 20px;
    line-height: 1.55;
}

.auth-side__list {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
    display: grid;
    gap: 10px;
}
.auth-side__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #dfe3f5;
}
.auth-side__list i {
    color: var(--auth-success);
    font-size: 1rem;
}

.auth-side__foot {
    border-top: 1px solid var(--auth-border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-side__foot small {
    color: var(--auth-muted);
    font-size: 0.78rem;
}

.avatars { display: flex; }
.avatars span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    border: 2px solid rgba(15,12,41,0.9);
    margin-left: -8px;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}
.avatars span:first-child { margin-left: 0; }
.avatars span:last-child {
    background: rgba(255,255,255,0.08);
    color: var(--auth-text);
    font-size: 0.65rem;
}

.auth-panel { padding: 36px 34px; }

/* ----- Alerts ----- */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    padding: 11px 14px;
    border-radius: var(--auth-radius-sm);
    margin-bottom: 14px;
    border: 1px solid transparent;
    animation: authCardIn 0.35s ease both;
}
.auth-alert i { margin-top: 1px; }
.auth-alert--success {
    background: rgba(67,233,123,0.08);
    border-color: rgba(67,233,123,0.28);
    color: #c5f7d6;
}
.auth-alert--success i { color: var(--auth-success); }

.auth-alert--error {
    background: rgba(255,107,129,0.08);
    border-color: rgba(255,107,129,0.28);
    color: #ffd2d8;
}
.auth-alert--error i { color: var(--auth-error); }

.auth-alert--info {
    background: rgba(79,172,254,0.08);
    border-color: rgba(79,172,254,0.28);
    color: #cfe8ff;
}

.auth-alert ul { margin: 0; padding-left: 1.1rem; }
.auth-alert li { margin: 2px 0; }

/* ----- Form ----- */

.auth-form { display: grid; gap: 16px; }

.auth-field { display: grid; gap: 6px; }

.auth-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #d5d9ec;
}
.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-input {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}
.auth-input > i {
    position: absolute;
    left: 13px;
    color: var(--auth-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.18s ease;
}

.auth-input input,
.auth-input select {
    flex: 1;
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--auth-text);
    font: inherit;
    font-size: 0.94rem;
    padding: 12px 42px 12px 40px;
    height: 46px;
    border-radius: var(--auth-radius-sm);
}

.auth-input select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--auth-muted) 50%),
        linear-gradient(135deg, var(--auth-muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 40px;
}
.auth-input select option { background: #1a1c34; color: #fff; }

.auth-input input::placeholder { color: #7d85a3; }

.auth-input:focus-within {
    border-color: var(--auth-primary);
    background: rgba(106,92,255,0.06);
    box-shadow: 0 0 0 4px rgba(106,92,255,0.15);
}
.auth-input:focus-within > i { color: var(--auth-primary-2); }

.auth-eye {
    position: absolute;
    right: 8px;
    background: transparent;
    border: 0;
    color: var(--auth-muted);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.auth-eye:hover { color: #fff; background: rgba(255,255,255,0.06); }

/* Two-column grid for name/password */
.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Password strength meter */
.auth-meter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: center;
    margin-top: 6px;
    position: relative;
}
.auth-meter > span {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    transition: background 0.22s ease;
}
.auth-meter > em {
    position: absolute;
    right: 0;
    top: 8px;
    font-size: 0.72rem;
    font-style: normal;
    color: var(--auth-muted);
    letter-spacing: 0.02em;
}
.auth-meter[data-score="1"] > span:nth-child(-n+1) { background: #ff6b81; }
.auth-meter[data-score="2"] > span:nth-child(-n+2) { background: #feca57; }
.auth-meter[data-score="3"] > span:nth-child(-n+3) { background: #4facfe; }
.auth-meter[data-score="4"] > span             { background: #43e97b; }

/* Checks */
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}
.auth-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid var(--auth-border-strong);
    background: rgba(255,255,255,0.04);
    margin-top: 2px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.auth-check input:checked {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    border-color: transparent;
}
.auth-check input:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='white' d='M6.7 11.3 3.4 8l1-1 2.3 2.3 4.9-4.9 1 1z'/></svg>") center/13px no-repeat;
}
.auth-check span { line-height: 1.4; }

.auth-inline-link {
    color: var(--auth-primary-2);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}
.auth-inline-link:hover { color: #fff; text-decoration: underline; }

/* Submit button */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border-radius: var(--auth-radius-sm);
    border: 0;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-2) 50%, var(--auth-accent));
    background-size: 200% 100%;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-position 0.5s ease;
    box-shadow: 0 12px 28px rgba(106,92,255,0.35);
    position: relative;
    overflow: hidden;
}
.auth-btn:hover {
    transform: translateY(-1px);
    background-position: 100% 0;
    box-shadow: 0 16px 36px rgba(106,92,255,0.5);
    color: #fff;
}
.auth-btn:active { transform: translateY(0); }
.auth-btn i { font-size: 1rem; }

.auth-btn--ghost {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--auth-border-strong);
    box-shadow: none;
    color: var(--auth-text);
}
.auth-btn--ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
    color: #fff;
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
    color: var(--auth-muted);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    background: var(--auth-border);
}
.auth-divider span {
    position: relative;
    background: var(--auth-card);
    padding: 0 10px;
}

/* Hint + help */
.auth-hint {
    margin: 14px 0 0;
    font-size: 0.78rem;
    color: var(--auth-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    text-align: center;
}
.auth-hint i { color: var(--auth-success); }

.auth-help {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    color: var(--auth-error);
    margin-top: 4px;
}

/* Step indicator */
.auth-step {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: var(--auth-muted);
}
.auth-step__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}
.auth-step__dot.is-active {
    background: var(--auth-primary-2);
    box-shadow: 0 0 0 4px rgba(106,92,255,0.2);
}

/* Footer */
.auth-footer {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--auth-muted);
    text-align: center;
    padding-bottom: 8px;
}
.auth-footer a {
    color: var(--auth-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}
.auth-footer a:hover { color: #fff; }

/* ----- Responsive ----- */

@media (max-width: 900px) {
    .auth-card--wide {
        grid-template-columns: 1fr;
        max-width: 520px;
    }
    .auth-side { display: none; }
    .auth-panel { padding: 30px 24px; }
    .auth-side__title { font-size: 1.3rem; }
}

@media (max-width: 520px) {
    .auth-card { padding: 24px 20px; }
    .auth-grid { grid-template-columns: 1fr; }
    .auth-card__title { font-size: 1.35rem; }
    .orb--1, .orb--2 { opacity: 0.35; }
    .balloon { opacity: 0.4 !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-bg,
    .orb,
    .balloon,
    .auth-card { animation: none !important; }
    .balloon { display: none; }
}