/* "Sign Up" bottom sheet on tenant pages (_TenantPartialSignUpModal). tenant.css already pins every .modal-dialog to the bottom. */

.signup-modal .modal-dialog {
    width: 100%;
    max-width: 500px;
}

.signup-modal .modal-content {
    border: none;
    border-radius: 1.25rem 1.25rem 0 0;
    max-height: 92vh;
    max-height: 92dvh;
    overflow: hidden;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .14);
}

/* Drag handle */
.signup-grabber {
    display: flex;
    justify-content: center;
    padding: .6rem 0 .1rem;
    cursor: grab;
    touch-action: none;
}

    .signup-grabber span {
        width: 2.5rem;
        height: .3rem;
        border-radius: 999px;
        background: #d4d7db;
    }

/* Header */
.signup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 1rem .75rem 1.25rem;
    border-bottom: none;
    touch-action: none;
}

.signup-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

    .signup-title .modal-title {
        margin: 0;
        overflow: hidden;
        font-size: 1rem;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.signup-avatar {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    background: #e9ecef;
}

.signup-avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    font-size: .95rem;
    font-weight: 700;
}

.signup-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f3f4;
    color: #495057;
    font-size: 1rem;
    transition: background-color .15s;
}

    .signup-close:hover {
        background: #e4e7e9;
    }

    .signup-close:focus-visible,
    .signup-tab:focus-visible,
    .signup-social-btn:focus-visible {
        outline: 2px solid #0d6efd;
        outline-offset: 2px;
    }

/* Body: only this part scrolls, so the title and the sticky submit stay in reach on short screens */
.signup-modal .modal-body {
    padding: 0 1.25rem 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: left;
}

/* Segmented control, same look as the pills on the tenant page */
.signup-tabs {
    display: flex;
    gap: .25rem;
    padding: .25rem;
    border-radius: 999px;
    background: #f1f3f4;
}

.signup-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .5rem .75rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #5f6368;
    font-size: .875rem;
    font-weight: 600;
    transition: background-color .15s, color .15s, box-shadow .15s;
}

    .signup-tab:hover {
        color: #202124;
    }

    .signup-tab.active {
        background: #fff;
        color: #202124;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    }

.signup-pane {
    width: 100%;
}

    .signup-pane:focus {
        outline: none;
    }

.signup-intro {
    margin: 1rem 0;
    color: #555;
    font-size: .875rem;
}

.signup-form {
    text-align: left;
}

.signup-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.signup-hint {
    margin: .4rem 0 1rem;
    color: #6b7280;
    font-size: .75rem;
}

.signup-alert {
    padding: .5rem .75rem;
    font-size: .8rem;
}

.signup-error {
    margin-top: .25rem;
    color: #dc3545;
    font-size: .75rem;
}

    .signup-error[hidden] {
        display: none;
    }

/* site.css gives ".auth-wrapper .form-control" its own padding and placeholder colour, which breaks floating labels */
#signUpModal .form-floating > .form-control {
    height: calc(3.5rem + 2px);
    padding: 1rem .75rem;
    line-height: 1.25;
}

#signUpModal .form-floating > .form-control:focus,
#signUpModal .form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: .625rem;
}

#signUpModal .form-floating > .form-control::placeholder {
    color: transparent;
}

/* Sticky submit: stays visible while a short screen scrolls the form */
.signup-submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -1.25rem;
    padding: 1rem 1.25rem .25rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 35%);
}

.signup-legal {
    margin: .6rem 0 0;
    color: #6b7280;
    font-size: .7rem;
    text-align: center;
}

    .signup-legal a {
        color: inherit;
        text-decoration: underline;
    }

/* Country + number as one field */
.signup-phone {
    display: flex;
    align-items: stretch;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

    .signup-phone:focus-within {
        border-color: #86b7fe;
        box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
    }

    .signup-phone.is-invalid {
        border-color: #dc3545;
    }

        .signup-phone.is-invalid:focus-within {
            box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .25);
        }

.signup-phone-country {
    position: relative;
    flex: none;
    border-right: 1px solid #e3e6e8;
}

    .signup-phone-country .form-select {
        height: 100%;
        min-height: calc(3.5rem);
        padding-left: .75rem;
        padding-right: 1.75rem;
        border: none;
        border-radius: .375rem 0 0 .375rem;
        background-color: transparent;
        box-shadow: none;
        font-size: .9rem;
        max-width: 11rem;
    }

/* With JavaScript the select shows just "US +1": its own text is hidden and the overlay takes over */
.signup-js .signup-phone-country .form-select {
    width: 6.25rem;
    color: transparent;
}

    .signup-js .signup-phone-country .form-select option {
        color: #212529;
    }

.signup-dial {
    display: none;
}

.signup-js .signup-dial {
    position: absolute;
    top: 50%;
    left: .75rem;
    display: block;
    color: #212529;
    font-size: .9rem;
    font-weight: 600;
    pointer-events: none;
    transform: translateY(-50%);
    white-space: nowrap;
}

.signup-phone-number {
    flex: 1;
    min-width: 0;
}

    #signUpModal .signup-phone-number > .form-control,
    #signUpModal .signup-phone-number > .form-control:focus {
        border: none;
        border-radius: 0 .375rem .375rem 0;
        box-shadow: none;
    }

/* Social sign-in */
.signup-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0 1rem;
    color: #6b7280;
    font-size: .75rem;
}

    .signup-divider::before,
    .signup-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #e3e6e8;
    }

.signup-social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: .5rem;
}

.signup-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem .75rem;
    border: 1px solid #dadce0;
    border-radius: 999px;
    background: #fff;
    color: #202124;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}

    .signup-social-btn:hover {
        border-color: #c4c7ca;
        background: #f8f9fa;
        color: #202124;
    }

    .signup-social-btn i {
        font-size: 1.05rem;
    }

.signup-social-google { color: #ea4335; }
.signup-social-facebook { color: #1877f2; }
.signup-social-linkedin { color: #0a66c2; }
.signup-social-microsoft { color: #00a4ef; }

.signup-social-btn.is-loading {
    pointer-events: none;
    opacity: .65;
}

/* Success */
.signup-success {
    padding: 1.75rem 0 .5rem;
    text-align: center;
}

    .signup-success:focus {
        outline: none;
    }

.signup-success-icon {
    margin-bottom: .75rem;
    color: #198754;
    font-size: 3rem;
    line-height: 1;
}

.signup-success:not([hidden]) .signup-success-icon {
    animation: signup-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}

@keyframes signup-pop {
    from {
        opacity: 0;
        transform: scale(.4);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.signup-success-email {
    word-break: break-all;
}

/* Once a sign-up has been sent, the social options and the tabs are no longer relevant */
.signup-modal.is-success [data-signup-extras],
.signup-modal.is-success .signup-tabs {
    display: none;
}

.signup-modal.is-dragging .modal-dialog {
    transition: none;
}

@media (max-width: 359.98px) {
    .signup-modal .modal-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .signup-submit-bar {
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .signup-success:not([hidden]) .signup-success-icon {
        animation: none;
    }

    .signup-tab,
    .signup-phone,
    .signup-social-btn {
        transition: none;
    }
}
