/* LOOPIN auth entry pages: Japanese minimal visual direction. */

.loopin-auth-body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(var(--zen-grid-line, rgba(61, 90, 138, 0.035)) 1px, transparent 1px),
        linear-gradient(90deg, var(--zen-grid-line, rgba(61, 90, 138, 0.035)) 1px, transparent 1px),
        var(--zen-bg, #FAFAF8);
    background-size: 32px 32px, 32px 32px, auto;
    color: var(--zen-text-primary, #2B2B2E);
    font-family: 'Noto Sans TC', 'Montserrat', 'Inter', system-ui, sans-serif;
    letter-spacing: 0;
}

.loopin-auth-body * {
    box-sizing: border-box;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-header {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1.25rem, 3vw, 2.75rem);
    border-bottom: 1px solid var(--zen-border, #E4E1DA);
    background: rgba(250, 250, 248, 0.92);
    backdrop-filter: blur(12px);
}

.auth-brand {
    color: var(--zen-accent-hover, #3D5A8A);
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-decoration: none;
}

.auth-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.auth-lang-link,
.auth-quiet-link {
    color: var(--zen-text-muted, #8B8983);
    text-decoration: underline;
    text-decoration-color: rgba(139, 137, 131, 0.35);
    text-underline-offset: 0.24em;
    transition: color var(--zen-fast, 0.12s) var(--zen-ease, ease),
        text-decoration-color var(--zen-fast, 0.12s) var(--zen-ease, ease);
}

.auth-lang-link {
    min-width: 2.75rem;
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    text-decoration: none;
}

.auth-lang-link:hover,
.auth-quiet-link:hover {
    color: var(--zen-text-primary, #2B2B2E);
    text-decoration-color: currentColor;
}

.auth-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(24rem, 42%) minmax(0, 58%);
}

.auth-form-panel {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3.5rem, 6vw, 6rem) clamp(2rem, 5vw, 4.5rem);
}

.auth-form-surface {
    width: min(100%, 25rem);
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.auth-steps {
    width: 100%;
}

.login-step {
    transition: opacity 280ms var(--zen-ease, ease), transform 280ms var(--zen-ease, ease);
}

.login-step.hidden {
    opacity: 0;
    transform: translateY(0.5rem);
    pointer-events: none;
}

.auth-title {
    margin: 0 0 0.5rem;
    color: var(--zen-text-primary, #2B2B2E);
    font-size: clamp(2rem, 3vw, 2.35rem);
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: 0;
}

.auth-subtitle {
    margin: 0 0 2rem;
    color: var(--zen-text-muted, #8B8983);
    font-size: 0.9375rem;
    font-weight: 300;
    line-height: 1.8;
}

.auth-account-row {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--zen-border, #E4E1DA);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.58);
}

.auth-account-text {
    min-width: 0;
    flex: 1;
    color: var(--zen-text-secondary, #5D5B56);
    font-size: 0.875rem;
    line-height: 1.5;
}

.auth-account-email {
    display: block;
    overflow: hidden;
    color: var(--zen-text-primary, #2B2B2E);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-icon-button {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--zen-border, #E4E1DA);
    border-radius: 999px;
    background: var(--zen-surface, #FFFFFF);
    color: var(--zen-text-secondary, #5D5B56);
    cursor: pointer;
    transition: border-color var(--zen-fast, 0.12s) var(--zen-ease, ease),
        color var(--zen-fast, 0.12s) var(--zen-ease, ease),
        transform var(--zen-fast, 0.12s) var(--zen-ease, ease);
}

.auth-icon-button:hover {
    border-color: var(--zen-border-hover, #C8C0B5);
    color: var(--zen-accent-hover, #3D5A8A);
    transform: translateX(-1px);
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--zen-text-secondary, #5D5B56);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    inset-block: 0;
    left: 0.875rem;
    display: inline-flex;
    align-items: center;
    color: var(--zen-text-muted, #8B8983);
    pointer-events: none;
}

.loopin-auth-body .auth-input {
    width: 100%;
    min-height: 3rem;
    height: 3rem;
    padding: 0 0.95rem 0 2.55rem;
    border: 1px solid var(--zen-border, #E4E1DA);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.78);
    color: var(--zen-text-primary, #2B2B2E);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color var(--zen-fast, 0.12s) var(--zen-ease, ease),
        box-shadow var(--zen-fast, 0.12s) var(--zen-ease, ease),
        background var(--zen-fast, 0.12s) var(--zen-ease, ease);
}

.loopin-auth-body .auth-input.auth-input--password {
    padding-right: 3.5rem;
}

.loopin-auth-body .auth-input::placeholder {
    color: rgba(43, 43, 46, 0.32);
}

.loopin-auth-body .auth-input:focus {
    outline: none;
    border-color: var(--zen-accent, #6E89B5);
    background: var(--zen-surface, #FFFFFF);
    box-shadow: 0 0 0 3px var(--zen-focus, rgba(110, 137, 181, 0.18));
}

.loopin-auth-body .auth-input.input-error,
.loopin-auth-body .auth-input:invalid:not(:placeholder-shown) {
    border-color: var(--zen-warning, #B96A5E);
}

.auth-toggle-password {
    position: absolute;
    inset-block: 0;
    right: 0.25rem;
    width: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--zen-text-muted, #8B8983);
    cursor: pointer;
    transition: color var(--zen-fast, 0.12s) var(--zen-ease, ease),
        background var(--zen-fast, 0.12s) var(--zen-ease, ease);
}

.auth-toggle-password:hover {
    background: var(--zen-surface-2, #F3F1EC);
    color: var(--zen-text-primary, #2B2B2E);
}

.auth-field-error {
    margin: 0.5rem 0 0;
    color: var(--zen-warning, #B96A5E);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.auth-field-error.hidden {
    display: none;
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.auth-remember {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--zen-text-muted, #8B8983);
    font-size: 0.875rem;
    cursor: pointer;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 1.2rem 0 1rem;
    color: rgba(43, 43, 46, 0.36);
    font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--zen-border, #E4E1DA);
}

.auth-btn {
    width: 100%;
    min-height: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    transition: background-color 180ms var(--zen-ease, ease),
        border-color 180ms var(--zen-ease, ease),
        color 180ms var(--zen-ease, ease),
        transform 180ms var(--zen-ease, ease);
}

.auth-btn--primary {
    border: 1px solid var(--zen-accent-hover, #3D5A8A) !important;
    background: var(--zen-accent-hover, #3D5A8A) !important;
    color: #FFFFFF !important;
}

.auth-btn--primary:hover,
.auth-btn--primary:focus {
    border-color: #304B75 !important;
    background: #304B75 !important;
    color: #FFFFFF !important;
}

.auth-btn--secondary {
    border: 1px solid var(--zen-border, #E4E1DA) !important;
    background: var(--zen-surface, #FFFFFF) !important;
    color: var(--zen-text-primary, #2B2B2E) !important;
}

.auth-btn--secondary:hover,
.auth-btn--secondary:focus {
    border-color: var(--zen-border-hover, #C8C0B5) !important;
    background: var(--zen-surface-alt, #F7F5F0) !important;
}

.auth-google-container,
.google-signin-container {
    width: 100%;
    min-height: 3rem;
}

.auth-google-container > div,
.auth-google-container iframe,
.google-signin-container > div,
.google-signin-container iframe,
#googleSignupContainer > div,
#googleSignupContainer iframe {
    width: 100% !important;
    max-width: 100% !important;
}

.auth-register-prompt {
    margin-top: 1rem;
    text-align: center;
    color: var(--zen-text-muted, #8B8983);
    font-size: 0.875rem;
}

.auth-register-link {
    color: var(--zen-accent-hover, #3D5A8A);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 0.24em;
}

.auth-register-card {
    width: min(100%, 28rem);
}

.auth-register-head {
    margin-bottom: 1.5rem;
}

.auth-register-title {
    margin: 0 0 0.45rem;
    color: var(--zen-text-primary, #2B2B2E);
    font-size: 1.85rem;
    font-weight: 400;
    line-height: 1.25;
}

.auth-register-subtitle {
    margin: 0;
    color: var(--zen-text-muted, #8B8983);
    font-size: 0.9375rem;
    font-weight: 300;
    line-height: 1.75;
}

.auth-register-form {
    display: grid;
    gap: 0.9rem;
}

.auth-register-form .auth-field {
    margin-bottom: 0;
}

.auth-register-otp-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
}

.auth-register-otp-btn {
    width: auto;
    min-width: 7rem;
    padding-inline: 1rem;
    white-space: nowrap;
}

.auth-register-hint {
    margin: -0.35rem 0 0;
    color: var(--zen-success, #7A9B7E);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.auth-register-rules {
    margin-top: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--zen-border, #E4E1DA);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.58);
}

.auth-register-rules p {
    color: var(--zen-text-muted, #8B8983) !important;
}

.auth-register-rules ul {
    margin: 0;
    padding: 0;
}

.auth-register-rules li {
    line-height: 1.55;
}

.auth-register-tos {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--zen-text-secondary, #5D5B56);
    font-size: 0.875rem;
    line-height: 1.65;
}

.auth-register-tos .checkbox {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.auth-register-actions {
    margin-top: 0.2rem;
}

.auth-register-footer-link {
    margin-top: 1.15rem;
    text-align: center;
    color: var(--zen-text-muted, #8B8983);
    font-size: 0.875rem;
}

.auth-register-modal .modal-box {
    width: min(28rem, calc(100vw - 2rem));
    max-width: min(28rem, calc(100vw - 2rem));
    max-height: min(44rem, calc(100vh - 2rem));
    padding: 1.75rem;
    overflow-y: auto;
    border: 1px solid var(--zen-border, #E4E1DA);
    border-radius: 1rem;
    background: rgba(250, 250, 248, 0.98);
    box-shadow: var(--zen-shadow-lg, 0 22px 64px rgba(14, 17, 22, 0.10));
}

.auth-tos-modal .modal-box {
    width: min(34rem, calc(100vw - 2rem));
    max-width: min(34rem, calc(100vw - 2rem));
}

.auth-register-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--zen-text-muted, #8B8983);
    cursor: pointer;
    transition: background var(--zen-fast, 0.12s) var(--zen-ease, ease),
        color var(--zen-fast, 0.12s) var(--zen-ease, ease),
        border-color var(--zen-fast, 0.12s) var(--zen-ease, ease);
}

.auth-register-close:hover {
    border-color: var(--zen-border, #E4E1DA);
    background: var(--zen-surface-2, #F3F1EC);
    color: var(--zen-text-primary, #2B2B2E);
}

.auth-alert,
.loopin-auth-body .alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid transparent;
    border-left-width: 3px;
    border-radius: 0.5rem;
    box-shadow: none;
    color: var(--zen-text-secondary, #5D5B56);
    font-size: 0.875rem;
    line-height: 1.55;
}

.auth-alert.hidden {
    display: none;
}

.auth-alert--warning,
.loopin-auth-body .alert-warning,
.loopin-auth-body .alert-error {
    border-color: rgba(194, 107, 87, 0.35);
    border-left-color: #C26B57;
    background: rgba(194, 107, 87, 0.10);
    color: #7E4639;
}

.auth-alert--success,
.loopin-auth-body .alert-success {
    border-color: rgba(122, 155, 126, 0.30);
    border-left-color: var(--zen-success, #7A9B7E);
    background: rgba(122, 155, 126, 0.12);
    color: #4F684F;
}

.auth-carousel-panel {
    position: relative;
    min-width: 0;
    display: flex;
    border-left: 1px solid var(--zen-border, #E4E1DA);
    overflow: hidden;
}

.auth-carousel {
    position: relative;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    background: var(--zen-surface-alt, #F7F5F0);
}

.auth-carousel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(250, 250, 248, 0.04), rgba(43, 43, 46, 0.18)),
        linear-gradient(var(--zen-grid-line, rgba(61, 90, 138, 0.035)) 1px, transparent 1px),
        linear-gradient(90deg, var(--zen-grid-line, rgba(61, 90, 138, 0.035)) 1px, transparent 1px);
    background-size: auto, 36px 36px, 36px 36px;
}

.auth-carousel .login-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 720ms var(--zen-ease, ease);
}

.auth-carousel .login-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.auth-carousel .login-slide > .relative {
    z-index: 2;
}

.auth-carousel .login-slide[data-media-type="ICON"] h2 {
    color: var(--zen-text-primary, #2B2B2E) !important;
}

.auth-carousel .login-slide:not([data-media-type="ICON"]) h2,
.auth-carousel .login-slide:not([data-media-type="ICON"]) p {
    color: #FFFFFF !important;
}

.auth-carousel .login-carousel-dot {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    cursor: pointer;
    transition: width 220ms var(--zen-ease, ease),
        background 220ms var(--zen-ease, ease),
        border-color 220ms var(--zen-ease, ease);
}

.auth-carousel .login-carousel-dot.active {
    width: 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    border-color: transparent;
}

.auth-carousel.icon-slide .login-carousel-dot {
    border-color: rgba(61, 90, 138, 0.28);
    background: rgba(61, 90, 138, 0.14);
}

.auth-carousel.icon-slide .login-carousel-dot.active {
    background: var(--zen-accent-hover, #3D5A8A);
}

.auth-carousel .login-carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(43, 43, 46, 0.18);
    color: #FFFFFF;
    cursor: pointer;
    opacity: 0;
    transition: opacity 180ms var(--zen-ease, ease), background 180ms var(--zen-ease, ease);
}

.auth-carousel:hover .login-carousel-arrow,
.auth-carousel .login-carousel-arrow:focus-visible {
    opacity: 0.78;
}

.auth-carousel .login-carousel-arrow:hover {
    background: rgba(43, 43, 46, 0.34);
}

.auth-carousel.icon-slide .login-carousel-arrow {
    border-color: rgba(61, 90, 138, 0.2);
    background: rgba(255, 255, 255, 0.62);
    color: var(--zen-accent-hover, #3D5A8A);
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem clamp(1.25rem, 3vw, 2.75rem);
    border-top: 1px solid var(--zen-border, #E4E1DA);
    background: rgba(250, 250, 248, 0.92);
    color: var(--zen-text-muted, #8B8983);
    font-size: 0.75rem;
}

.auth-footer a {
    color: var(--zen-text-secondary, #5D5B56);
    text-decoration: underline;
    text-decoration-color: rgba(93, 91, 86, 0.28);
    text-underline-offset: 0.22em;
}

.auth-footer a:hover {
    color: var(--zen-text-primary, #2B2B2E);
    text-decoration-color: currentColor;
}

.auth-footer-copy,
.auth-footer-agreement,
.auth-footer-nav {
    margin: 0;
}

.auth-footer-agreement,
.auth-footer-nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.auth-recovery-visual {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-left: 1px solid var(--zen-border, #E4E1DA);
    background:
        linear-gradient(var(--zen-grid-line, rgba(61, 90, 138, 0.035)) 1px, transparent 1px),
        linear-gradient(90deg, var(--zen-grid-line, rgba(61, 90, 138, 0.035)) 1px, transparent 1px),
        var(--zen-surface-alt, #F7F5F0);
    background-size: 36px 36px, 36px 36px, auto;
}

.auth-recovery-mark {
    width: min(70%, 22rem);
    aspect-ratio: 1;
    position: relative;
}

.auth-recovery-mark::before,
.auth-recovery-mark::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(61, 90, 138, 0.38);
}

.auth-recovery-mark::before {
    inset: 10%;
}

.auth-recovery-mark::after {
    inset: 24%;
    border-radius: 999px;
}

.auth-recovery-line {
    position: absolute;
    inset: 50% 4%;
    height: 1px;
    background: rgba(61, 90, 138, 0.28);
    transform: rotate(-36deg);
}

.auth-recovery-copy {
    position: absolute;
    left: clamp(2rem, 6vw, 4.5rem);
    bottom: clamp(2rem, 6vw, 4.5rem);
    max-width: 22rem;
}

.auth-recovery-copy h3 {
    margin: 0 0 0.55rem;
    color: var(--zen-text-primary, #2B2B2E);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.45;
}

.auth-recovery-copy p {
    margin: 0;
    color: var(--zen-text-muted, #8B8983);
    font-size: 0.9375rem;
    font-weight: 300;
    line-height: 1.8;
}

.email-autocomplete-list {
    border-color: var(--zen-border, #E4E1DA) !important;
    border-radius: 0.5rem !important;
    box-shadow: var(--zen-shadow-sm, 0 8px 24px rgba(43, 43, 46, 0.045)) !important;
}

@media (max-width: 1023px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-form-panel {
        padding: clamp(2.75rem, 8vw, 4.5rem) 1.5rem;
    }

    .auth-carousel-panel,
    .auth-recovery-visual {
        order: -1;
        min-height: 14rem;
        border-left: 0;
        border-bottom: 1px solid var(--zen-border, #E4E1DA);
    }

    .auth-carousel .login-slide > .relative {
        justify-content: center !important;
        padding: 2rem !important;
    }

    .auth-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .auth-header {
        min-height: 4rem;
        padding: 0.875rem 1rem;
    }

    .auth-brand {
        font-size: 1.15rem;
    }

    .auth-carousel-panel,
    .auth-recovery-visual {
        display: none;
    }

    .auth-form-panel {
        align-items: flex-start;
        padding: 3.5rem 1.25rem 2.5rem;
    }

    .auth-title {
        font-size: 1.85rem;
    }

    .auth-form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }

    .auth-footer {
        padding: 1rem;
    }

    .auth-footer-agreement,
    .auth-footer-nav {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .auth-register-modal .modal-box {
        padding: 1.35rem;
    }

    .auth-register-otp-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-register-otp-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loopin-auth-body *,
    .loopin-auth-body *::before,
    .loopin-auth-body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
