/* ==========================================================================
   Greystar Modern Auth Design System (Sign In & Register)
   Featuring:
   - Dynamic RGB mesh gradient background
   - Animated RGB card border frame & aura
   - Professional modern input fields with animated RGB active border glow
   - Seamless autofill styling preservation
   - Responsive multi-column layout for registration
   - Interactive password reveal toggles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&display=swap');

:root {
    --gs-ink: #0A2245;
    --gs-ink-2: #1E3A5F;
    --gs-muted: #64748B;
    --gs-primary: #0077D4;
    --gs-primary-glow: rgba(0, 119, 212, 0.4);
    --gs-accent-gold: #FFD972;
    --gs-border-subtle: #E2E8F0;
    --gs-card-bg: rgba(255, 255, 255, 0.97);
}

* {
    box-sizing: border-box;
}

body.auth-page {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #06152B 0%, #160B33 25%, #082852 50%, #1F0D3D 75%, #051A36 100%);
    background-size: 300% 300%;
    animation: rgbPageGradient 14s ease infinite;
    min-height: 100vh;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    color: var(--gs-ink-2);
}

@keyframes rgbPageGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Ambient RGB Mesh Background Layer (Fixed & GPU-Accelerated)
   ========================================================================== */
.gs-rgb-bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.gs-rgb-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(85px);
    opacity: 0.55;
    will-change: transform;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

.gs-orb-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #0077D4 0%, #00E5FF 65%, transparent 100%);
    top: -120px;
    left: -120px;
    animation-duration: 16s;
}

.gs-orb-2 {
    width: 580px;
    height: 580px;
    background: radial-gradient(circle, #7928CA 0%, #FF0080 65%, transparent 100%);
    bottom: -140px;
    right: -140px;
    animation-duration: 20s;
}

.gs-orb-3 {
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, #00DFD8 0%, #0077D4 65%, transparent 100%);
    top: 35%;
    left: 55%;
    animation-duration: 15s;
}

@keyframes orbFloat {
    0% { transform: translate(0px, 0px) scale(1); }
    50% { transform: translate(45px, -45px) scale(1.12); }
    100% { transform: translate(-35px, 35px) scale(0.92); }
}

/* ==========================================================================
   Auth Main Wrapper
   ========================================================================== */
.auth-wrapper {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 16px;
}

/* ==========================================================================
   RGB Border Frame & Ambient Aura
   ========================================================================== */
.gs-auth-frame {
    position: relative;
    width: 100%;
    max-width: 460px;
    border-radius: 30px;
    padding: 2.5px; /* RGB border thickness */
    background: linear-gradient(135deg, #0077D4, #7928CA, #FF0080, #00DFD8, #0077D4);
    background-size: 300% 300%;
    animation: rgbGradientFlow 7s ease infinite;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.gs-auth-frame.gs-register-frame {
    max-width: 720px;
}

/* Ambient RGB aura behind the frame */
.gs-auth-frame::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 36px;
    background: linear-gradient(135deg, #0077D4, #7928CA, #FF0080, #00DFD8, #0077D4);
    background-size: 300% 300%;
    filter: blur(24px);
    opacity: 0.55;
    z-index: -1;
    animation: rgbGradientFlow 7s ease infinite;
}

@keyframes rgbGradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Inner Card */
.gs-auth-card {
    background: var(--gs-card-bg);
    border-radius: 28px;
    padding: 44px 38px 40px;
    width: 100%;
    text-align: center;
}

/* Logo & Header */
.gs-auth-logo {
    display: block;
    margin: 0 auto 18px auto;
    height: 34px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(10, 34, 69, 0.08));
}

.gs-auth-header h1 {
    font-family: 'Manrope', sans-serif;
    color: var(--gs-ink);
    font-weight: 800;
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
}

.gs-auth-header p {
    color: var(--gs-muted);
    font-size: 14.5px;
    line-height: 1.5;
    margin: 0 0 28px 0;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.gs-auth-alert {
    border-radius: 14px;
    padding: 13px 18px;
    font-family: 'Manrope', sans-serif;
    font-size: 13.5px;
    margin-bottom: 22px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.gs-auth-alert.info {
    background: #EFF6FF;
    border-left: 4px solid #0077D4;
    color: #1E40AF;
}

.gs-auth-alert.success {
    background: #F0FDF4;
    border-left: 4px solid #16A34A;
    color: #166534;
}

.gs-auth-alert.error {
    background: #FEF2F2;
    border-left: 4px solid #DC2626;
    color: #991B1B;
}

.gs-auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

/* ==========================================================================
   Professional & Modern Form Fields with Active RGB Border Glow
   ========================================================================== */
.gs-auth-form {
    text-align: left;
}

/* 2-column grid for register page */
.gs-auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

@media (max-width: 680px) {
    .gs-auth-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.gs-input-group {
    margin-bottom: 20px;
}

.gs-input-label {
    display: block;
    font-family: 'Manrope', sans-serif;
    color: #475569;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 7px;
    transition: color 0.25s ease;
}

.gs-input-group:focus-within .gs-input-label {
    color: var(--gs-primary);
}

/* Professional Input Container */
.gs-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 52px;
    background: #FFFFFF;
    border: 1.5px solid var(--gs-border-subtle);
    border-radius: 14px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(10, 34, 69, 0.03);
    overflow: hidden;
}

/* Leading Icon */
.gs-field-icon {
    width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #94A3B8;
    flex-shrink: 0;
    transition: color 0.25s ease;
}

/* Professional Input */
.gs-field-input {
    flex-grow: 1;
    height: 100%;
    border: none !important;
    background: transparent !important;
    color: var(--gs-ink) !important;
    font-family: 'Manrope', sans-serif !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    padding: 0 12px 0 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.gs-field-input::placeholder {
    color: #94A3B8 !important;
    font-weight: 400 !important;
    font-size: 13.5px !important;
}

/* Prevent Chrome/Edge default autofill from breaking styles */
.gs-field-input:-webkit-autofill,
.gs-field-input:-webkit-autofill:hover,
.gs-field-input:-webkit-autofill:focus,
.gs-field-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 40px #FFFFFF inset !important;
    -webkit-text-fill-color: #0A2245 !important;
    font-family: 'Manrope', sans-serif !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    caret-color: #0A2245 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Trailing Password Reveal Toggle */
.gs-pwd-toggle {
    width: 38px;
    height: 38px;
    margin-right: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.gs-pwd-toggle:hover {
    color: var(--gs-primary);
    background: #F1F5F9;
}

/* ==========================================================================
   THE ACTIVE RGB BORDER GLOW
   Smooth, continuous, luminous RGB transition on active focused fields
   ========================================================================== */
.gs-field-wrap:focus-within {
    background: #FFFFFF;
    animation: activeRgbGlow 3.5s linear infinite;
}

.gs-field-wrap:focus-within .gs-field-icon {
    color: var(--gs-primary);
}

@keyframes activeRgbGlow {
    0% {
        border-color: #0077D4;
        box-shadow: 0 0 0 3px rgba(0, 119, 212, 0.22), 0 0 18px rgba(0, 119, 212, 0.45);
    }
    25% {
        border-color: #7928CA;
        box-shadow: 0 0 0 3px rgba(121, 40, 202, 0.22), 0 0 18px rgba(121, 40, 202, 0.45);
    }
    50% {
        border-color: #FF0080;
        box-shadow: 0 0 0 3px rgba(255, 0, 128, 0.22), 0 0 18px rgba(255, 0, 128, 0.45);
    }
    75% {
        border-color: #00DFD8;
        box-shadow: 0 0 0 3px rgba(0, 223, 216, 0.22), 0 0 18px rgba(0, 223, 216, 0.45);
    }
    100% {
        border-color: #0077D4;
        box-shadow: 0 0 0 3px rgba(0, 119, 212, 0.22), 0 0 18px rgba(0, 119, 212, 0.45);
    }
}

/* ==========================================================================
   Form Controls, Checkbox & Links
   ========================================================================== */
.gs-form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 13.5px;
    font-family: 'Manrope', sans-serif;
}

.gs-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--gs-ink-2);
    font-weight: 600;
}

.gs-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--gs-primary);
    cursor: pointer;
    border-radius: 4px;
}

.gs-link-btn {
    background: transparent;
    border: none;
    color: var(--gs-primary);
    font-family: 'Manrope', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.15s ease;
}

.gs-link-btn:hover {
    color: #0077D4;
    text-decoration: none !important;
}

@keyframes gsBtnRgbGlow {
    0% {
        box-shadow: 0 0 16px rgba(0, 119, 212, 0.75), 0 0 30px rgba(121, 40, 202, 0.45), 0 4px 14px rgba(10, 34, 69, 0.2);
    }
    33% {
        box-shadow: 0 0 18px rgba(121, 40, 202, 0.75), 0 0 32px rgba(0, 229, 255, 0.5), 0 4px 14px rgba(10, 34, 69, 0.2);
    }
    66% {
        box-shadow: 0 0 18px rgba(0, 229, 255, 0.75), 0 0 32px rgba(0, 119, 212, 0.55), 0 4px 14px rgba(10, 34, 69, 0.2);
    }
    100% {
        box-shadow: 0 0 16px rgba(0, 119, 212, 0.75), 0 0 30px rgba(121, 40, 202, 0.45), 0 4px 14px rgba(10, 34, 69, 0.2);
    }
}

/* ==========================================================================
   Submit Button with Dynamic RGB Glow
   ========================================================================== */
.gs-auth-submit-btn {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, #0077D4 0%, #0F2D59 50%, #0077D4 100%);
    background-size: 200% 200%;
    color: #FFFFFF;
    font-family: 'Manrope', sans-serif;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 119, 212, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    text-decoration: none !important;
}

.gs-auth-submit-btn:hover {
    background-position: 100% 0%;
    transform: translateY(-2px);
    text-decoration: none !important;
    animation: gsBtnRgbGlow 2.8s linear infinite !important;
    box-shadow: 0 0 20px rgba(0, 119, 212, 0.7), 0 0 32px rgba(121, 40, 202, 0.5) !important;
}

.gs-auth-submit-btn:active {
    transform: translateY(0);
}

/* Additional Switch Links */
.gs-auth-footer-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(10, 34, 69, 0.08);
    font-family: 'Manrope', sans-serif;
    font-size: 13.5px;
    color: var(--gs-muted);
}

.gs-auth-footer-links a {
    color: var(--gs-primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s ease;
}

.gs-auth-footer-links a:hover {
    color: #00477F;
    text-decoration: underline;
}

/* Responsive adjust */
@media (max-width: 576px) {
    .gs-auth-card {
        padding: 34px 22px 30px;
        border-radius: 24px;
    }
    .gs-auth-frame {
        border-radius: 26px;
    }
    .gs-auth-header h1 {
        font-size: 23px;
    }
}
