/* auth.css - Chat-style authentication page */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Borna', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #050509;
    color: #ffffff;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.auth-viewport {
    width: 100%;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.auth-hero {
    position: relative;
    width: min(1400px, 100%);
    height: auto;
    aspect-ratio: 1681 / 662;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
    background-color: #14151c;
}

.auth-hero-image {
    position: absolute;
    inset: 0;
    background-image: url('/img/supergen-hero.jpg');
    background-size: cover;
    background-position: center center;
    filter: saturate(1.1);
    transform: scale(1.02);
}

.auth-hero-left,
.auth-hero-right {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
}

.auth-hero-left {
    left: 0;
    width: 40%;
    align-items: flex-start;
}

.auth-hero-right {
    right: 0;
    width: 36%;
    align-items: flex-end;
}

.auth-welcome-text {
    color: #ffffff;
    font-size: 45px;
    letter-spacing: -0.05em;
    width: 32vw;
}

.auth-welcome-heading {
    font-size: 3rem;
    font-weight: 100;
    margin: 0 0 20px 2%;
    line-height: 1;
    display: block;
    width: 100%;
}

.auth-logo-image {
    width: 200px;
    height: auto;
    vertical-align: middle;
    margin-left: 0.15em;
}

.auth-welcome-brand {
    font-size: 3.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.auth-welcome-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}

.auth-chat-container {
    width: 100%;
    max-width: 380px;
    pointer-events: auto;
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Chat bubbles (based on wizard.css) */
.auth-bubble {
    position: relative;
    display: inline-block;
    padding: 12px 18px;
    background: rgba(12, 13, 20, 0.96);
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(35, 36, 42, 0.5), 0 1px 3px rgba(0, 0, 0, 0.6);
    max-width: 100%;
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-out;
    backdrop-filter: blur(18px);
    white-space: pre-line;
}

.auth-bubble.visible {
    opacity: 1;
    transform: translateY(0);
}

.auth-bubble.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.auth-bubble.typing::after {
    content: '▋';
    margin-left: 2px;
    animation: authBlink 0.7s infinite;
}

@keyframes authBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.auth-bubble.clickable {
    cursor: pointer;
    background: rgba(18, 20, 30, 0.96);
}

.auth-bubble.clickable:hover {
    background: rgba(25, 28, 40, 0.98);
}

/* Resize wrapper when input appears inside bubble */
.auth-bubble-input-wrap {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
}

.auth-bubble-input-wrap.auth-bubble-input-wrap-visible {
    max-height: 220px;
}

/* Input row entrance (same as bubbles) */
.auth-input-row-entrance {
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-out;
}

.auth-input-row-entrance.auth-input-row-entrance-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Bubbles that contain an input row */
.auth-bubble-has-input .auth-input-row {
    margin-top: 10px;
}

.auth-bubble-has-input .auth-link-button,
.auth-bubble-has-input .auth-input-row + div {
    margin-top: 8px;
}

/* Input rows */
.auth-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.auth-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    background: #ffffff;
    color: #000000;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
    border-color: #ff9e9e;
    box-shadow: 0 0 0 1px rgba(255, 158, 158, 0.6);
    background: #ffffff;
}

.auth-input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}
input:autofill {
    background-color: rgb(255, 243, 219) !important; 
}
.auth-btn {
    padding: 10px 0;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 1);
    color: #ff9e9e;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Borna', -apple-system, 'Helvetica Neue', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-12px);
    transition: width 0.35s ease-out, min-width 0.35s ease-out, padding 0.35s ease-out, opacity 0.3s ease-out, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, box-shadow 0.2s ease;
}

.auth-input-row.has-input .auth-btn {
    width: auto;
    min-width: 90px;
    padding-left: 22px;
    padding-right: 22px;
    overflow: visible;
    opacity: 1;
    transform: translateX(0);
}

.auth-btn:hover {
    background: rgba(0, 0, 0, 0.52);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.auth-btn:active {
    transform: translateX(0) translateY(1px);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.auth-email-readonly {
    font-size: 0.86rem;
    opacity: 0.9;
}

.auth-email-readonly span {
    font-weight: 600;
}

.auth-inline-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.auth-link-button {
    margin-top: 6px;
    padding: 0;
    border: none;
    background: none;
    color: #ff9e9e;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
}

.auth-link-button:hover {
    text-decoration: underline;
}

.auth-error-text {
    color: #ff6b81;
}

.auth-success-text {
    color: #2ed573;
}

.auth-footer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Mobile / tablet adjustments */
@media (max-width: 1024px) {
    .auth-hero-left {
        width: 45%;
    }
    
    .auth-hero-right {
        width: 45%;
    }
}

@media (max-width: 768px) {
    .auth-viewport {
        padding: 16px 12px;
    }

    .auth-hero {
        aspect-ratio: 9 / 16;
    }

    .auth-hero-left {
        display: none;
    }

    .auth-hero-right {
        width: 100%;
        padding: 24px 20px;
        align-items: center;
        justify-content: flex-end;
        background: linear-gradient(to top, rgba(5, 5, 10, 0.92), transparent 60%);
    }

    .auth-chat-container {
        max-width: 100%;
    }
}

/* =============================================
   MOBILE PHONE PORTRAIT (max-width: 480px)
   ============================================= */
@media (max-width: 480px) {
    .auth-viewport {
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }

    .auth-hero {
        aspect-ratio: auto;
        height: 100vh;
        width: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        box-shadow: none;
    }

    /* Show .auth-hero-left at top center */
    .auth-hero-left {
        display: flex;
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        height: auto;
        padding: 48px 16px 24px 16px;
        text-align: center;
        align-items: center;
        justify-content: center;
        background: linear-gradient(to bottom, rgba(5, 5, 10, 0.85), transparent 100%);
        z-index: 2;
    }

    .auth-welcome-text {
        width: 100%;
        text-align: center;
        font-size: 18px;
    }

    .auth-welcome-heading {
        text-align: center;
        font-size: 1.2rem;
        margin: 0 auto 8px auto;
        width: 100%;
    }    .auth-logo-image {
        width: 130px;
        margin: 0;
    }

    /* .auth-hero-right positioned below, vertically near center */
    .auth-hero-right {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        height: auto;
        flex: 1;
        padding: 16px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: linear-gradient(to top, rgba(5, 5, 10, 0.92), transparent 60%);
        z-index: 2;
    }

    .auth-chat-container {
        width: 100%;
        max-width: calc(100% - 32px);
        align-self: center;
    }

    .auth-bubble {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    .auth-input {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    .auth-footer {
        padding: 16px;
        position: relative;
        z-index: 2;
    }
}

/* Landscape on small screens - same mobile layout */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-hero {
        height: 100vh;
        overflow-y: auto;
    }

    .auth-hero-left {
        padding: 24px 16px 16px 16px;
    }

    .auth-logo-image {
        width: 100px;
    }

    .auth-welcome-heading {
        font-size: 1rem;
    }
}
