/* PixIsland — Auth Pages (Login + Cadastro) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ========== Tokens ========== */
:root {
    --bg: #0C0514;
    --bg-2: #130824;
    --fg: #F2ECFF;
    --muted: #C7BEE4;
    --primary: #A785FF;
    --primary-2: #6E4BFF;
    --card: #1B1230;
    --border: #2F2150;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 10px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg-2);
    color: var(--fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--fg); }

::selection { background: rgba(167,133,255,0.3); }

/* ========== Layout ========== */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
}

/* ========== Visual Panel (Left) ========== */
.auth-visual {
    background: var(--bg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grid background */
.auth-visual__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(167,133,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167,133,255,0.035) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 70%);
    pointer-events: none;
}

/* Orb */
.auth-visual__orb {
    width: min(380px, 70vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(40% 40% at 50% 50%, rgba(167,133,255,0.2), transparent 60%),
        radial-gradient(30% 30% at 50% 50%, rgba(110,75,255,0.12), transparent 65%);
    box-shadow:
        inset 0 0 80px rgba(167,133,255,0.1),
        0 0 120px rgba(167,133,255,0.06),
        0 0 240px rgba(110,75,255,0.04);
    animation: orbPulse 6s ease-in-out infinite;
    position: relative;
}

.auth-visual__orb::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image:
        linear-gradient(rgba(167,133,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167,133,255,0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle, black 35%, transparent 65%);
    -webkit-mask-image: radial-gradient(circle, black 35%, transparent 65%);
}

/* Notification cards */
.auth-notif {
    position: absolute;
    background: rgba(27,18,48,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(167,133,255,0.12);
    border-radius: 12px;
    padding: 14px 18px;
    max-width: 280px;
    z-index: 2;
}

.auth-notif--1 {
    top: 28%;
    right: 12%;
    animation: float 6s ease-in-out infinite;
}

.auth-notif--2 {
    bottom: 28%;
    left: 8%;
    animation: float 6s ease-in-out infinite 1.5s;
}

.auth-notif__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.auth-notif__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}
.auth-notif__dot:nth-child(2) { background: var(--primary-2); }

.auth-notif__time {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--muted);
    opacity: 0.6;
}

.auth-notif__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 2px;
}

.auth-notif__text {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Bottom phrase */
.auth-phrase {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    z-index: 2;
}

.auth-phrase p {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    font-weight: 600;
    color: rgba(199,190,228,0.7);
    line-height: 1.5;
}

.auth-phrase strong {
    color: var(--primary);
    font-weight: 700;
}

/* ========== Form Panel (Right) ========== */
.auth-form-panel {
    background: var(--bg-2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.auth-form {
    width: 100%;
    max-width: 400px;
}

/* Error / Success messages */
.auth-error {
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(239,68,68,0.1);
    border-left: 3px solid var(--error);
    color: var(--error);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.auth-error.shake {
    animation: shake 0.4s ease;
}

.auth-success {
    text-align: center;
    padding: 32px 20px;
}

.auth-success h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 16px 0 8px;
}

.auth-success p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}

/* Button spinner */
.auth-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    text-decoration: none;
}

.auth-logo svg { width: 32px; height: 32px; flex-shrink: 0; }

.auth-logo__text {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--fg);
}

/* Heading */
.auth-heading {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Input Group */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: color var(--transition);
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(12,5,20,0.6);
    color: var(--fg);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.input-group input::placeholder {
    color: var(--muted);
    opacity: 0.55;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(167,133,255,0.1);
}

.input-group input:focus ~ .input-group__icon {
    color: var(--primary);
}

/* Password toggle */
.input-group__toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    display: flex;
    transition: color var(--transition);
}
.input-group__toggle:hover { color: var(--primary); }
.input-group__toggle svg { width: 18px; height: 18px; }

/* Forgot link */
.auth-forgot {
    display: block;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 24px;
    margin-top: -8px;
}
.auth-forgot:hover { color: var(--fg); }

/* Auth button */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(167,133,255,0.3);
    margin-bottom: 20px;
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(167,133,255,0.45);
}

.auth-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Bottom link */
.auth-bottom-link {
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
}

.auth-bottom-link a {
    color: var(--primary);
    font-weight: 600;
}

/* ========== Animations ========== */
@keyframes orbPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 80px rgba(167,133,255,0.1),
            0 0 120px rgba(167,133,255,0.06),
            0 0 240px rgba(110,75,255,0.04);
    }
    50% {
        box-shadow:
            inset 0 0 100px rgba(167,133,255,0.16),
            0 0 160px rgba(167,133,255,0.1),
            0 0 300px rgba(110,75,255,0.06);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    body { overflow-y: auto; }

    .auth-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 30vh 1fr;
        height: auto;
        min-height: 100vh;
    }

    .auth-visual__orb { width: 200px; }

    .auth-notif { display: none; }

    .auth-phrase {
        bottom: 12px;
        left: 16px;
        right: 16px;
    }
    .auth-phrase p { font-size: 0.85rem; }

    .auth-form-panel { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .auth-form-panel { padding: 24px 16px; }
    .auth-logo { margin-bottom: 24px; }
}
