@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
    --bg-main: #070d18;
    --bg-soft: #0f1a2d;
    --surface: rgba(14, 23, 39, 0.86);
    --surface-strong: rgba(12, 20, 34, 0.95);
    --line: rgba(141, 169, 197, 0.24);
    --text: #ecf2ff;
    --text-soft: #9ab1ca;
    --brand: #00b4d8;
    --brand-soft: #0ec4b5;
    --accent: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    padding: clamp(12px, 2.6vw, 30px);
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 14% 8%, rgba(0, 180, 216, 0.2), transparent 34%),
        radial-gradient(circle at 82% 88%, rgba(245, 158, 11, 0.15), transparent 34%),
        linear-gradient(150deg, #060c16, #081324 44%, #0b1829 100%);
    display: grid;
    place-items: center;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(154, 177, 202, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(154, 177, 202, 0.06) 1px, transparent 1px);
    background-size: 35px 35px;
}

.background-animation {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.circle {
    position: absolute;
    border-radius: 999px;
    filter: blur(4px);
    opacity: 0.34;
    animation: drift 16s ease-in-out infinite;
}

.circle-1 {
    width: 260px;
    height: 260px;
    left: -70px;
    top: -70px;
    background: rgba(0, 180, 216, 0.3);
}

.circle-2 {
    width: 300px;
    height: 300px;
    right: -110px;
    bottom: -120px;
    background: rgba(14, 196, 181, 0.24);
    animation-delay: 6s;
}

.circle-3 {
    width: 200px;
    height: 200px;
    left: 48%;
    top: 44%;
    background: rgba(245, 158, 11, 0.2);
    animation-delay: 10s;
}

@keyframes drift {
    0%,
    100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(24px, -22px);
    }
}

.back-home {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(11, 18, 30, 0.84);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    padding: 9px 14px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.back-home:hover {
    transform: translateX(-2px);
    border-color: rgba(0, 180, 216, 0.5);
}

.login-wrapper {
    width: min(1080px, 100%);
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(9, 15, 26, 0.88);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.48);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: authPanelEnter 0.5s ease both;
}

@keyframes authPanelEnter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.side-panel {
    padding: clamp(34px, 4.2vw, 52px);
    background:
        radial-gradient(circle at 84% 10%, rgba(0, 180, 216, 0.3), transparent 34%),
        linear-gradient(160deg, #0a2239, #112f4b 54%, #0e243a);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 44px;
    height: 44px;
}

.logo-section h1 {
    font-family: "JetBrains Mono", monospace;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}

.welcome-text {
    margin-top: 18px;
    font-size: clamp(1.65rem, 2.5vw, 2.2rem);
    line-height: 1.1;
    font-weight: 700;
}

.subtitle {
    margin-top: 10px;
    color: rgba(236, 242, 255, 0.82);
    font-size: 0.94rem;
    line-height: 1.7;
    max-width: 34ch;
}

.features-list {
    margin-top: 24px;
    display: grid;
    gap: 12px;
}

.feature-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: start;
    border: 1px solid rgba(236, 242, 255, 0.2);
    border-radius: 14px;
    background: rgba(236, 242, 255, 0.06);
    padding: 11px;
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(0, 180, 216, 0.25);
    font-size: 1.2rem;
}

.feature-item h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.feature-item p {
    font-size: 0.8rem;
    color: rgba(236, 242, 255, 0.84);
}

.login-container {
    background: rgba(8, 14, 24, 0.94);
    padding: clamp(28px, 4.2vw, 50px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-container.is-switching {
    opacity: 0.62;
    transform: translateY(5px);
}

.form-header h2 {
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    line-height: 1.2;
    margin-bottom: 7px;
}

.form-subtitle {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

form {
    display: grid;
    gap: 12px;
}

.input-group {
    display: grid;
    gap: 6px;
}

.input-group label {
    color: #cfe2f8;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.input-group label svg {
    stroke: #6edff7;
}

.input-group input {
    border: 1px solid rgba(141, 169, 197, 0.36);
    border-radius: 12px;
    background: rgba(14, 24, 39, 0.96);
    color: var(--text);
    padding: 12px 13px;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: rgba(0, 180, 216, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.17);
}

.input-group input::placeholder {
    color: #88a2bf;
}

button[type="submit"] {
    margin-top: 8px;
    border: 1px solid rgba(0, 180, 216, 0.38);
    border-radius: 12px;
    background: linear-gradient(120deg, #00d0f7, #11cab8);
    color: #032735;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 13px 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 180, 216, 0.26);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px rgba(0, 180, 216, 0.3);
}

.btn-icon {
    transition: transform 0.2s ease;
}

button[type="submit"]:hover .btn-icon {
    transform: translateX(3px);
}

.divider {
    margin: 16px 0;
    display: flex;
    align-items: center;
    color: #7f97b3;
    font-size: 0.8rem;
    gap: 10px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(141, 169, 197, 0.28);
}

#toggle-auth {
    text-align: center;
    color: var(--text-soft);
    font-size: 0.88rem;
}

#toggle-link {
    color: #74e7fc;
    font-weight: 700;
    cursor: pointer;
}

#toggle-link:hover {
    color: #fcd34d;
}

#error {
    margin-top: 10px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.13);
    color: #fecaca;
    font-size: 0.84rem;
    padding: 0 12px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, max-height 0.2s ease, transform 0.2s ease, padding 0.2s ease;
}

#error.show {
    padding: 10px 12px;
    max-height: 90px;
    opacity: 1;
    transform: translateY(0);
}

#nome-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: max-height 0.26s ease, opacity 0.2s ease, transform 0.2s ease;
}

#nome-container.show {
    max-height: 120px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .login-wrapper {
        animation: none;
    }

    .login-container,
    #error,
    #nome-container {
        transition: none;
    }
}

@media (max-width: 980px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .side-panel {
        display: none;
    }
}

@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .login-wrapper {
        border-radius: 18px;
    }

    .login-container {
        padding: 22px;
    }

    .back-home {
        top: 12px;
        left: 12px;
        padding: 8px 12px;
    }
}