/* Login and signup: desktop split panel and mobile single form. */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.auth-main {
    flex: 1;
    padding: 28px 20px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    position: relative;
    width: min(900px, 100%);
    min-height: 620px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

/* Desktop form panel positioning. */
.auth-form-container {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: var(--white);
    transition:
        transform 0.6s ease-in-out,
        opacity 0.6s ease-in-out;
}

.auth-login-container {
    left: 0;
    z-index: 2;
    transform: translateX(0);
    opacity: 1;
}

.auth-signup-container {
    left: 0;
    z-index: 1;
    transform: translateX(0);
    opacity: 0;
}

/* Form content and headings. */
.auth-form {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 40px;
    overflow-y: auto;
    box-sizing: border-box;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-bottom: 30px;
    color: var(--primary);
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-heading h1 {
    margin: 0;
    color: var(--primary);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

.auth-heading p {
    margin: 9px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Shared login and signup fields. */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 13px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa0a7;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(181, 131, 141, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Password visibility controls and hints. */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-input {
    padding-right: 46px !important;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        color var(--transition),
        background var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--surface);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.eye-icon {
    display: block;
}

.eye-off-icon {
    display: none;
}

.password-hint {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.password-label-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    width: fit-content;
    max-width: 100%;
}

.password-label-row label {
    margin-bottom: 0;
}

.password-info-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 3px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}

.password-info-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
}

.password-info-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.password-info-hint {
    position: absolute;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);
    z-index: 10;
    width: min(230px, calc(100vw - 210px));
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    color: var(--text-muted);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    line-height: 1.5;
}

input[type='password']::-ms-reveal,
input[type='password']::-ms-clear {
    display: none;
}

input[type='password']::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
}

/*BUTTON*/
.auth-button {
    width: 100%;
    padding: 12px 16px;
    margin-top: 4px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background var(--transition),
        transform var(--transition);
}

.auth-button:hover {
    background: var(--primary-light);
}

.auth-button:active {
    transform: translateY(1px);
}

/*REQUEST OWNER LINK*/
.request-owner-link {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.request-owner-link p {
    margin: 0 0 6px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.request-owner-link a {
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.request-owner-link a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Desktop brand panel. */
.auth-overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    z-index: 10;
    transition: transform 0.6s ease-in-out;
}

.auth-overlay {
    position: relative;
    left: -100%;
    width: 200%;
    height: 100%;
    background: var(--primary);
    color: var(--white);
    transition: transform 0.6s ease-in-out;
}

.auth-overlay-panel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.auth-overlay-left {
    left: 0;
}

.auth-overlay-right {
    right: 0;
}

.overlay-brand-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
}

.auth-overlay-panel h2 {
    margin: 0 0 14px;
    color: var(--white);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

.auth-overlay-panel > p:not(.overlay-question) {
    max-width: 320px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.7;
}

.overlay-question {
    margin: 30px 0 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.auth-outline-button {
    padding: 11px 32px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition);
}

.auth-outline-button:hover {
    background: var(--white);
    color: var(--primary);
}

/* Desktop transition between login and signup. */
.auth-container.right-panel-active .auth-login-container {
    transform: translateX(100%);
    opacity: 0;
}

.auth-container.right-panel-active .auth-signup-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
}

.auth-container.right-panel-active .auth-overlay-container {
    transform: translateX(-100%);
}

.auth-container.right-panel-active .auth-overlay {
    transform: translateX(50%);
}

/* Compact, centered login and signup forms on small screens. */
.auth-mobile-switch {
    display: none;
}

@media (max-width: 800px) {
    .auth-main {
        align-items: safe center;
        padding: 24px 16px;
    }

    .auth-container {
        width: min(480px, 100%);
        min-height: 0;
        overflow: visible;
    }

    .auth-container .auth-login-container,
    .auth-container .auth-signup-container,
    .auth-container.right-panel-active .auth-login-container,
    .auth-container.right-panel-active .auth-signup-container {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        transform: none;
        opacity: 1;
        z-index: auto;
        transition: none;
    }

    .auth-container .auth-signup-container,
    .auth-container.right-panel-active .auth-login-container {
        display: none;
    }

    .auth-container.right-panel-active .auth-signup-container {
        display: block;
    }

    .auth-overlay-container {
        display: none;
    }

    .auth-container .auth-form {
        height: auto;
        overflow: visible;
        padding: 32px clamp(20px, 5vw, 36px);
    }

    .auth-form input {
        font-size: 16px;
    }

    .auth-mobile-switch {
        display: block;
        margin: 22px 0 0;
        text-align: center;
        font-size: 14px;
        line-height: 1.6;
    }
}
/* Additional spacing for narrow phones. */
@media (max-width: 420px) {
    .auth-main {
        padding: 12px;
    }
    .auth-container {
        min-height: 0;
        border-radius: 20px;
    }
    .auth-form {
        padding: 30px 24px;
    }
    .auth-heading h1 {
        font-size: 24px;
    }
    .auth-brand {
        margin-bottom: 24px;
    }
}

/*REGISTRATION FEEDBACK MESSAGES*/
.application-error {
    background-color: #fff1f1;
    color: #a33333;
    border: 1px solid #e8b8b8;
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.registration-success {
    display: block;
    background-color: #edf8f0;
    color: #286b40;
    border: 1px solid #b8dfc3;
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

/* Single, naturally sized form on narrow screens. */
.auth-mobile-switch a {
    color: var(--primary);
    font-weight: 600;
    text-underline-offset: 3px;
}
.auth-mobile-switch a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}
