/* SaasGMS Auth Page Styles - 2 Column Layout with Project Theme Elements */
html {
    scrollbar-gutter: stable;
    /* Prevent layout shift when scrollbar appears/disappears */
}

:root {
    --auth-bg-page: #000000;
    /* Project Primary (Black) */
    --auth-bg-card: #000000;
    /* Project Secondary (Dark Grey) */
    --auth-bg-input: #171717;
    --auth-text-white: #ffffff;
    --auth-text-black: #000000;
    --auth-text-secondary: rgba(235, 235, 245, 0.75);
    --auth-border-subtle: rgba(235, 235, 245, 0.16);
    --auth-font-family: 'Inter', sans-serif;
    --auth-btn-bg: #ffffff;
    --auth-btn-text: #000000;
    --saasgms-button-height: 48px;
    --saasgms-input-height: 48px;
    --saasgms-input-radius: 1rem;
    --saasgms-input-border: 1px solid var(--Label-Tertiary, rgba(235, 235, 245, 0.16));
    --saasgms-input-bg: var(--BG-Second, #252525);
    --saasgms-input-padding: 1rem 1.5rem;
    --saasgms-input-color: var(--Label-Primary, #FFF);
    --saasgms-input-font-family: Inter, sans-serif;
    --saasgms-input-font-size: 1.125rem;
    --saasgms-input-font-style: normal;
    --saasgms-input-font-weight: 500;
    --saasgms-input-line-height: 136%;
    --saasgms-input-letter-spacing: -0.01125rem;
    --saasgms-select-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    --saasgms-select-icon-size: 18px 18px;
    --saasgms-select-icon-offset-x: 22px;
    --saasgms-select-padding-right: 56px;
    --saasgms-select-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 18px rgba(0, 0, 0, 0.35);
    --saasgms-select-border-color: rgba(255, 255, 255, 0.14);
    --saasgms-select-hover-border-color: rgba(255, 255, 255, 0.22);
    --saasgms-select-focus-border-color: var(--auth-text-white);
    --saasgms-select-focus-ring: 0 0 0 2px rgba(255, 255, 255, 0.08);
    --saasgms-select-menu-bg: #252525;
    --saasgms-select-menu-color: #ffffff;
    --saasgms-select-menu-muted: rgba(255, 255, 255, 0.6);
    --saasgms-select-option-selected-bg: #3a3a3a;
    --saasgms-select-option-selected-color: #ffffff;
    --saasgms-label-color: var(--Label-Secondary, rgba(255, 255, 255, 0.50));
    --saasgms-label-font-family: Inter, sans-serif;
    --saasgms-label-font-size: 1.125rem;
    --saasgms-label-font-style: normal;
    --saasgms-label-font-weight: 500;
    --saasgms-label-line-height: 136%;
    --saasgms-label-letter-spacing: -0.01125rem;
}

.saasgms-auth-wrapper {
    display: flex;
    min-height: 100vh;
    align-items: center;
    /* Center vertically like Google's */
    justify-content: center;
    background-color: var(--bg-secondary, #171717);
    /* Page slightly lighter to contrast black card? Or just standard black */
    font-family: var(--font-family, var(--auth-font-family));
    box-sizing: border-box;
    padding: 16px;
    color: var(--auth-text-white);
}

.saasgms-auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    /* Ensure strict centering */
    /* Wide card for 2 columns */
    background-color: var(--auth-bg-card);
    /* Primary Black */
    border: 1px solid var(--auth-border-subtle);
    /* Border to define card on dark bg */
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    /* Inner border effect */
    box-shadow: 0px 4px 24px rgba(0, 0, 0, 0.4);
    min-height: 520px;
    /* Ensure substantial height */
}

@media (max-width: 900px) {
    .saasgms-auth-card {
        grid-template-columns: 1fr;
        max-width: 560px;
        min-height: auto;
    }
}

/* Left Column - Info */
.saasgms-auth-col-left {
    padding: 64px 48px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Fix grid overflow */
    justify-content: space-between;
    /* Pushes content: Top vs Bottom */
}

/* Container for Logo, Title, Desc to stay at top */
.saasgms-auth-top-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.saasgms-auth-logo {
    width: 42px;
    height: 48px;
    margin-bottom: 24px;
}

.saasgms-auth-logo svg {
    width: 100%;
    height: 100%;
}

.saasgms-auth-title {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.72px;
    color: var(--auth-text-white);
    margin: 0 0 24px 0;
}

.saasgms-auth-desc {
    font-size: 16px;
    /* Slightly reduced as per previous step preference, but close to 18px */
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: -0.18px;
    color: var(--auth-text-white);
    opacity: 0.9;
    margin: 0 0 16px;
}


/* Right Column - Form */
.saasgms-auth-col-right {
    padding: 64px 48px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;

    @media only screen and (max-width: 900px) {
        padding-top: 0;
    }
}

/* Form Styles */
.saasgms-auth-form-group {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.saasgms-auth-inputs {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.saasgms-auth-field {
    display: flex;
    flex-direction: column;
    /*gap: 8px;*/
}

.saasgms-auth-label {
    font-size: var(--saasgms-label-font-size);
    font-weight: var(--saasgms-label-font-weight);
    line-height: var(--saasgms-label-line-height);
    letter-spacing: var(--saasgms-label-letter-spacing);
    color: var(--saasgms-label-color);
    font-family: var(--saasgms-label-font-family);
    font-style: var(--saasgms-label-font-style);
    margin-left: 0;
    margin-bottom: 16px;
    padding: 0 24px;
}

.saasgms-auth-input-wrapper {
    position: relative;
    width: 100%;
}

/* Input: Project Theme Sizing */
.saasgms-auth-input {
    width: 100%;
    padding: var(--saasgms-input-padding);
    /* Similar to project 10px 14px but balanced */
    border-radius: var(--saasgms-input-radius);
    background: var(--saasgms-input-bg);
    border: var(--saasgms-input-border);
    font-size: var(--saasgms-input-font-size);
    color: var(--saasgms-input-color);
    font-family: var(--saasgms-input-font-family);
    font-style: var(--saasgms-input-font-style);
    font-weight: var(--saasgms-input-font-weight);
    line-height: var(--saasgms-input-line-height);
    letter-spacing: var(--saasgms-input-letter-spacing);
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
    height: var(--saasgms-input-height);
    /* Fixed height for consistency */
}

.saasgms-auth-input::placeholder {
    color: var(--auth-border-subtle);
}

.saasgms-auth-input-border {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 1px solid transparent;
    pointer-events: none;
    transition: border-color 0.2s;
}

.saasgms-auth-input:focus {
    border-color: var(--auth-text-white);
}

/* Baseline input styling */
.saasgms-auth-wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.saasgms-auth-wrapper textarea,
.saasgms-auth-wrapper select {
    border-radius: var(--saasgms-input-radius);
    border: var(--saasgms-input-border);
    background: var(--saasgms-input-bg);
    color: var(--saasgms-input-color);
    font-family: var(--saasgms-input-font-family);
    font-size: var(--saasgms-input-font-size);
    font-style: var(--saasgms-input-font-style);
    font-weight: var(--saasgms-input-font-weight);
    line-height: var(--saasgms-input-line-height);
    letter-spacing: var(--saasgms-input-letter-spacing);
}

.saasgms-auth-wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.saasgms-auth-wrapper select {
    height: var(--saasgms-input-height);
    padding: var(--saasgms-input-padding);
}

.saasgms-auth-wrapper textarea {
    padding: var(--saasgms-input-padding);
    min-height: 56px;
}

.saasgms-auth-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: var(--saasgms-select-icon);
    background-repeat: no-repeat;
    background-position: right var(--saasgms-select-icon-offset-x) center;
    background-size: var(--saasgms-select-icon-size);
    padding-right: var(--saasgms-select-padding-right);
    box-shadow: var(--saasgms-select-shadow);
    border-color: var(--saasgms-select-border-color);
}

.saasgms-auth-wrapper select:hover {
    border-color: var(--saasgms-select-hover-border-color);
}

.saasgms-auth-wrapper select:focus {
    border-color: var(--saasgms-select-focus-border-color);
    outline: none;
    box-shadow: var(--saasgms-select-focus-ring);
}

.saasgms-auth-wrapper select {
    color-scheme: dark;
}

.saasgms-auth-wrapper select option,
.saasgms-auth-wrapper select optgroup {
    background-color: var(--saasgms-select-menu-bg);
    color: var(--saasgms-select-menu-color);
    font-family: var(--saasgms-input-font-family);
    font-size: var(--saasgms-input-font-size);
    font-weight: var(--saasgms-input-font-weight);
}

.saasgms-auth-wrapper select optgroup {
    color: var(--saasgms-select-menu-muted);
    font-weight: 600;
}

.saasgms-auth-wrapper select option:checked,
.saasgms-auth-wrapper select option[selected] {
    background-color: var(--saasgms-select-option-selected-bg);
    color: var(--saasgms-select-option-selected-color);
}

/* Custom Select (auth page local copy of base styles) */
.saasgms-auth-wrapper select.saasgms-select-native--enhanced {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.saasgms-auth-wrapper .saasgms-cselect {
    position: relative;
    width: 100%;
}

.saasgms-auth-wrapper .saasgms-cselect.is-disabled {
    opacity: 0.55;
}

.saasgms-auth-wrapper .saasgms-cselect-trigger {
    width: 100%;
    min-height: var(--saasgms-input-height);
    height: var(--saasgms-input-height);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: var(--saasgms-input-radius);
    border: var(--saasgms-input-border);
    background: var(--saasgms-input-bg);
    color: var(--saasgms-input-color);
    font-family: var(--saasgms-input-font-family);
    font-size: var(--saasgms-input-font-size);
    font-style: var(--saasgms-input-font-style);
    font-weight: var(--saasgms-input-font-weight);
    line-height: var(--saasgms-input-line-height);
    letter-spacing: var(--saasgms-input-letter-spacing);
    padding: var(--saasgms-input-padding);
    padding-right: var(--saasgms-select-padding-right);
    box-shadow: var(--saasgms-select-shadow);
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.saasgms-auth-wrapper .saasgms-cselect-trigger:hover {
    border-color: var(--saasgms-select-hover-border-color);
}

.saasgms-auth-wrapper .saasgms-cselect-trigger:focus-visible {
    border-color: var(--saasgms-select-focus-border-color);
    outline: none;
    box-shadow: var(--saasgms-select-focus-ring);
}

.saasgms-auth-wrapper .saasgms-cselect-trigger:disabled {
    cursor: not-allowed;
}

.saasgms-auth-wrapper .saasgms-cselect-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    right: var(--saasgms-select-icon-offset-x);
    width: 18px;
    height: 18px;
    background-image: var(--saasgms-select-icon);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform: translateY(-50%);
    transition: transform 0.18s ease;
    pointer-events: none;
    opacity: 0.92;
}

.saasgms-auth-wrapper .saasgms-cselect.is-open .saasgms-cselect-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.saasgms-auth-wrapper .saasgms-cselect-trigger-label {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.saasgms-auth-wrapper .saasgms-cselect-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 80;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.saasgms-auth-wrapper .saasgms-cselect.is-open .saasgms-cselect-menu {
    display: block;
}

.saasgms-auth-wrapper .saasgms-cselect.is-open-up .saasgms-cselect-menu {
    top: auto;
    bottom: calc(100% + 8px);
}

.saasgms-auth-wrapper .saasgms-cselect-option {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    margin: 0;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
    border: none;
}

.saasgms-auth-wrapper .saasgms-cselect-option:hover,
.saasgms-auth-wrapper .saasgms-cselect-option.is-active {
    background: rgba(255, 255, 255, 0.06);
}

.saasgms-auth-wrapper .saasgms-cselect-option.is-selected {
    background: rgba(225, 245, 239, 0.08);
}

.saasgms-auth-wrapper .saasgms-cselect-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Bottom Navigation / Actions */
.saasgms-auth-actions-group {
    display: flex;
    flex-direction: column;
    /* Stack button row and terms */
    align-items: flex-end;
    /* Align to right */
    justify-content: flex-end;
    margin-top: 48px;
    gap: 16px;
    /* Space between button row and terms */
}

.saasgms-auth-terms {
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-text-secondary);
    text-align: right;
    /* Ensure text matches right alignment */
    max-width: 340px;
    /* Constrain width for better reading block */
    margin: 0;
}

.saasgms-auth-terms a {
    color: var(--auth-text-white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s;
}

.saasgms-auth-terms a:hover {
    border-color: var(--auth-text-white);
}

/* Social Buttons */
.saasgms-auth-socials {
    display: flex;
    gap: 16px;
}

.saasgms-social-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--saasgms-button-height);
    /* Matches Input/Button Height */
    width: var(--saasgms-button-height);
    border-radius: 16px;
    background-color: var(--auth-btn-bg);
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    padding: 0;
    /* Optional: Add visible border if needed, removed for clean look */
}

.saasgms-social-btn:hover {
    transform: scale(1.05);
}

.saasgms-social-btn:active {
    transform: scale(0.95);
}

.saasgms-social-btn-border {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 1px solid var(--auth-border-subtle);
    pointer-events: none;
}


/* "Next" Primary Button - Visuals handled by .btn .btn-primary */
.saasgms-auth-submit {
    height: var(--saasgms-button-height);
    /* Match height of social buttons/inputs */
    /* Resetting some specific spacing/alignment if needed */
}

/* Removed :hover and :active to let btn-primary handle interactions */

/* Switch Link Styling (Create Account / Login) */
.saasgms-auth-switch-text {
    text-align: right;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.36;
    letter-spacing: -0.09px;
    color: var(--auth-text-white);
    margin-right: 24px;
}

.saasgms-auth-switch-link {
    color: var(--auth-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    margin-top: 4px;
}

.saasgms-auth-switch-link:hover {
    color: var(--auth-text-white);
}

.saasgms-auth-nav-container {
    display: flex;
    align-items: center;
}


/* Helpers */
.saasgms-hidden {
    display: none;
}



/* Messages - Stylish Glass */
.saasgms-messages {
    margin-bottom: 24px;
}

.saasgms-alert {
    padding: 12px 14px;
    /* Theme padding */
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(255, 69, 58, 0.1);
    color: #FF453A;
    border: 1px solid rgba(255, 69, 58, 0.2);
}

.saasgms-success {
    background: rgba(48, 209, 88, 0.1);
    color: #30D158;
    border: 1px solid rgba(48, 209, 88, 0.2);
}

.saasgms-alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.7;
}

.saasgms-auth-lang {
    position: absolute;
    bottom: 56px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 24px;
    pointer-events: auto;
}

.saasgms-auth-lang .saasgms-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--auth-text-secondary);
}

.saasgms-auth-lang .saasgms-lang-label {
    font-size: 15px;
    letter-spacing: 0.08em;
}

.saasgms-auth-lang .saasgms-lang-select {
    background-color: rgba(255, 255, 255, 0.08);
    background-image: var(--saasgms-select-icon);
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 8px;
    padding: 6px 28px 6px 10px;
    font-size: 15px;
    box-shadow: none;
}

.saasgms-auth-lang .saasgms-lang-select + .saasgms-cselect .saasgms-cselect-trigger {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 15px;
}

.saasgms-auth-lang .saasgms-lang-select + .saasgms-cselect .saasgms-cselect-menu {
    min-width: 160px;
}

/* Footer Styling (Outside Card) - Dark Theme Style */
.saasgms-auth-footer-row {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.saasgms-footer-link {
    color: var(--auth-text-secondary);
    font-size: 15px;
    text-decoration: none;
    margin-left: 16px;
}

@media (max-width: 900px) {
    .saasgms-auth-wrapper {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        min-height: 100dvh;
        padding: 16px;
        gap: 12px;
    }

    .saasgms-card-stack {
        width: 100%;
    }

    .saasgms-auth-lang,
    .saasgms-auth-footer-row {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
    }

    .saasgms-auth-lang {
        margin-top: auto;
        padding: 0 8px;
    }

    .saasgms-auth-footer-row {
        padding: 8px 8px 16px;
    }
}
