/* ============================================================
   COLABVERSE AUTHENTICATION
   Shared styles for:
   - Registration
   - Login
   - Password recovery
   - Google authentication
   ============================================================ */

/* 1. GLOBAL STYLES */

:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #090b16;
    color: #f6f6ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

a {
    color: #a9a1ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 2. MAIN LAYOUT */

.layout {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(430px, 1fr);
    min-height: 100vh;
}

/* 3. BRAND PANEL */

.brand-panel {
    position: relative;
    overflow: hidden;
    padding: 48px 7%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background:
        radial-gradient(
            ellipse at 25% 28%,
            #44308c 0%,
            transparent 47%
        ),
        radial-gradient(
            ellipse at 90% 90%,
            #123b85 0%,
            transparent 50%
        ),
        linear-gradient(135deg, #15132d, #0b1025);

    border-right: 1px solid #34304c;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border: 1px solid #7773db55;
    border-radius: 50%;
    right: -100px;
    top: 20%;

    box-shadow:
        0 0 0 65px #7773db0b,
        0 0 0 130px #7773db08;

    pointer-events: none;
}

/* 4. COLABVERSE LOGO */

.logo {
    display: inline-flex;
    gap: 11px;
    align-items: center;
    max-width: 100%;
    color: white;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.logo:hover {
    text-decoration: none;
}

/* New ColabVerse image logo */

.brand-logo {
    display: block;
    width: min(100%, 260px);
    height: auto;
    object-fit: contain;
}

/* Retained for compatibility with other templates */

.logo-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: linear-gradient(135deg, #8b5cf6, #3379ed);
    box-shadow: 0 6px 26px #6856ff55;
}

/* 5. BRAND CONTENT */

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 580px;
}

.eyebrow,
.section-label {
    font-size: 12px;
    letter-spacing: 2.5px;
    font-weight: 800;
    color: #b6a6ff;
}

.brand-content h1 {
    font-size: clamp(46px, 5.2vw, 78px);
    line-height: 1.1;
    letter-spacing: -3px;
    margin: 24px 0;
}

.brand-content h1 span {
    background: linear-gradient(100deg, #c5a4ff, #75b9ff);
    background-clip: text;
    color: transparent;
}

.brand-content p {
    color: #b8bbd6;
    font-size: 18px;
    line-height: 1.8;
    max-width: 470px;
}

.chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 35px;
}

.chips span {
    font-size: 12px;
    border: 1px solid #78749e66;
    border-radius: 30px;
    padding: 11px 14px;
    background: #ffffff0b;
    color: #dedbf4;
}

.brand-foot {
    color: #989bb6;
    font-size: 13px;
}

/* 6. FORM PANEL */

.form-panel {
    padding: 50px 9% 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #0b0d1b;
}

.form-wrap {
    width: 100%;
    max-width: 440px;
    margin: auto;
}

.mobile-logo {
    display: none;
}

.section-label {
    margin-bottom: 16px;
}

.form-wrap h2 {
    font-size: clamp(29px, 3vw, 39px);
    letter-spacing: -1.3px;
    margin: 0 0 10px;
}

.subtitle {
    color: #9fa3bb;
    line-height: 1.7;
    margin: 0 0 34px;
}

/* 7. AUTHENTICATION FORMS */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.field label {
    font-size: 14px;
    font-weight: 650;
    color: #e7e8f7;
}

.field input {
    width: 100%;
    border: 1px solid #34374f;
    background: #141727;
    color: #fff;
    padding: 15px 16px;
    border-radius: 11px;
    font: inherit;
    outline: none;

    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.field input:focus {
    border-color: #9784ff;
    box-shadow: 0 0 0 3px #8672fc24;
}

.field input::placeholder {
    color: #737992;
}

/* 8. PASSWORD FIELDS */

.field-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.field-top a {
    font-size: 13px;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 75px;
}

.toggle-password {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #aaa6ef;
    font-weight: 650;
    padding: 10px;
    cursor: pointer;
}

/* 9. REMEMBER ME */

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #b8bbd0;
    font-size: 14px;
}

.checkbox input {
    accent-color: #8967ff;
    width: 17px;
    height: 17px;
}

/* 10. PRIMARY BUTTON */

.primary-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 0;
    border-radius: 11px;
    padding: 16px 18px;
    font: inherit;
    font-weight: 750;
    color: #fff;
    background: linear-gradient(110deg, #8658ef, #5a73e8);
    cursor: pointer;
    box-shadow: 0 12px 25px #5143b42d;

    transition:
        filter 0.2s,
        transform 0.2s;
}

.primary-button:hover {
    filter: brightness(1.13);
    transform: translateY(-1px);
    text-decoration: none;
}

.primary-button:focus-visible {
    outline: 3px solid #b6a6ff;
    outline-offset: 3px;
}

.button-link {
    margin-top: 25px;
}

/* 11. GOOGLE AUTHENTICATION */

.social-auth {
    width: 100%;
    margin-top: 26px;
}

/* Divider between password and Google authentication */

.social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 24px;
    color: #8e93ad;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #34374f;
}

.social-divider span {
    flex-shrink: 0;
}

/* Google authentication button */

.google-button {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 18px;
    border: 1px solid #41445f;
    border-radius: 11px;
    background: #171a2b;
    color: #f6f6ff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;

    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s,
        box-shadow 0.2s;
}

.google-button:hover {
    background: #22263d;
    border-color: #8b80f5;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px #00000025;
}

.google-button:active {
    transform: translateY(0);
}

.google-button:focus-visible {
    outline: 3px solid #b6a6ff;
    outline-offset: 3px;
}

.google-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 12. HELPER TEXT AND LINKS */

.switch {
    text-align: center;
    color: #a7a9bd;
    font-size: 14px;
    margin: 28px 0 0;
}

.switch a {
    font-weight: 700;
}

.hint {
    font-size: 12px;
    color: #9fa3bb;
    line-height: 1.6;
    margin: -7px 0 0;
}

/* 13. ALERTS AND VALIDATION */

.alert {
    border-radius: 10px;
    padding: 13px 15px;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 20px;
}

.alert-error {
    background: #54233655;
    color: #ffb9cc;
    border: 1px solid #a94c6e;
}

.alert-success {
    background: #184b3b66;
    color: #b4f5d6;
    border: 1px solid #3b9877;
}

.errorlist {
    color: #ff9ab7;
    font-size: 12px;
    line-height: 1.5;
    margin: 3px 0;
    padding-left: 18px;
}

/* 14. FOOTER AND NOTICE */

.form-footer {
    color: #686e86;
    font-size: 12px;
    text-align: center;
    margin-top: 30px;
}

.notice-text {
    margin-bottom: 15px;
}

/* 15. RESPONSIVE DESIGN */

@media (max-width: 900px) {

    .layout {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        min-height: 100vh;
        padding: 28px 24px;
    }

    .mobile-logo {
        display: block;
        margin-bottom: 55px;
    }

    .mobile-logo .brand-logo {
        width: min(100%, 220px);
    }

    .form-wrap {
        max-width: 460px;
    }

    .form-footer {
        margin-top: 40px;
    }
}

@media (max-width: 440px) {

    .form-panel {
        padding: 22px 18px;
    }

    .form-wrap h2 {
        font-size: 29px;
    }

    .auth-form {
        gap: 17px;
    }

    .social-auth {
        margin-top: 22px;
    }

    .google-button {
        min-height: 50px;
        padding: 14px 16px;
    }
}

/* ============================================================
   16. COLABVERSE PAGE ANIMATIONS
   ============================================================ */

/* Smooth entrance for the logo */
.brand-panel .logo,
.mobile-logo .logo {
    animation: logoEntrance 0.9s ease-out both;
}

/* Heading appears with a gentle upward movement */
.brand-content h1 {
    animation: contentEntrance 0.9s ease-out 0.15s both;
}

/* Description follows the heading */
.brand-content p {
    animation: contentEntrance 0.9s ease-out 0.3s both;
}

/* Feature labels appear last */
.chips {
    animation: contentEntrance 0.9s ease-out 0.45s both;
}

/* Authentication form enters smoothly */
.form-wrap {
    animation: formEntrance 0.85s ease-out both;
}

/* Subtle animated glow behind the branding */
.brand-panel {
    background-size: 140% 140%;
    animation: backgroundGlow 14s ease-in-out infinite alternate;
}

/* Logo entrance */
@keyframes logoEntrance {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Text entrance */
@keyframes contentEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form entrance */
@keyframes formEntrance {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slowly move the existing gradient background */
@keyframes backgroundGlow {
    from {
        background-position: 0% 0%;
    }

    to {
        background-position: 100% 100%;
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .brand-panel,
    .brand-panel .logo,
    .mobile-logo .logo,
    .brand-content h1,
    .brand-content p,
    .chips,
    .form-wrap {
        animation: none;
    }
}

/* ColabVerse logo styling */
.brand-logo {
    display: block;
    width: min(100%, 260px);
    height: auto;
    object-fit: contain;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

/* Logo container */
.brand-panel .logo {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Google authentication button */

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.google-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================================
   17. COMPACT COLABVERSE REGISTRATION PAGE
   ============================================================ */

/*
   These changes apply only to the registration page.

   The registration form contains #id_password2.
   This allows us to identify it without changing
   the login or password recovery pages.
*/

/* Reduce the registration panel's vertical spacing. */
.form-panel:has(#id_password2) {
    padding-top: 20px;
    padding-bottom: 12px;
}

/* Keep the registration form centered and compact. */
.form-panel:has(#id_password2) .form-wrap {
    max-width: 440px;
}

/* Reduce the space below the section label. */
.form-panel:has(#id_password2) .section-label {
    margin-bottom: 8px;
}

/* Make the registration heading slightly smaller. */
.form-panel:has(#id_password2) h2 {
    font-size: clamp(27px, 2.6vw, 34px);
    margin-bottom: 6px;
}

/* Reduce the space below the description. */
.form-panel:has(#id_password2) .subtitle {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Reduce spacing between registration fields. */
.form-panel:has(#id_password2) .auth-form {
    gap: 11px;
}

/* Reduce spacing between labels and inputs. */
.form-panel:has(#id_password2) .field {
    gap: 5px;
}

/* Keep labels readable. */
.form-panel:has(#id_password2) .field label {
    font-size: 13px;
}

/* Make input fields slightly shorter. */
.form-panel:has(#id_password2) .field input {
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 14px;
}

/* Reduce password guidance spacing. */
.form-panel:has(#id_password2) .hint {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
}

/* Make the registration button more compact. */
.form-panel:has(#id_password2) .primary-button {
    padding: 12px 16px;
    border-radius: 9px;
}

/* Reduce spacing before Google registration. */
.form-panel:has(#id_password2) .social-auth {
    margin-top: 14px;
}

/* Reduce spacing around the OR divider. */
.form-panel:has(#id_password2) .social-divider {
    margin-bottom: 12px;
}

/* Keep the Google button compact. */
.form-panel:has(#id_password2) .google-button {
    min-height: 44px;
    padding: 11px 16px;
    border-radius: 9px;
}

/* Preserve the multicolored Google logo. */
.form-panel:has(#id_password2) .google-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Reduce spacing above the sign-in link. */
.form-panel:has(#id_password2) .switch {
    margin-top: 14px;
    font-size: 13px;
}

/* Reduce footer spacing on the registration page. */
.form-panel:has(#id_password2) .form-footer {
    margin-top: 14px;
}

/* ============================================================
   SMALL LAPTOP SCREENS
   ============================================================ */

@media (max-height: 800px) and (min-width: 901px) {

    .form-panel:has(#id_password2) {
        padding-top: 12px;
        padding-bottom: 10px;
    }

    .form-panel:has(#id_password2) .auth-form {
        gap: 8px;
    }

    .form-panel:has(#id_password2) .field input {
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .form-panel:has(#id_password2) .subtitle {
        margin-bottom: 12px;
    }

}

/* ============================================================
   MOBILE REGISTRATION
   ============================================================ */

@media (max-width: 900px) {

    .form-panel:has(#id_password2) {
        padding: 24px 20px;
    }

    .form-panel:has(#id_password2) .form-wrap {
        max-width: 460px;
    }

}