/* Glass-панели, формы входа/регистрации, PIN-keypad */

.auth-card__lead {
    text-align: center;
    color: var(--chrome-400);
    font-size: 0.92rem;
    margin-bottom: 1.35rem !important;
}

.glass-panel {
    position: relative;
    isolation: isolate;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-card);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 16px 48px var(--shadow-tint), inset 0 1px 0 var(--glass-highlight);
}

.glass-panel::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: calc(var(--radius-card) - 1px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-btn);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--chrome-100);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s, border-color var(--transition-ui);
    text-decoration: none;
}

.glass-btn:active {
    transform: scale(0.98);
}

.glass-btn--primary {
    background: var(--accent-rose);
    border-color: transparent;
    color: #fff;
}

.glass-btn--primary:active {
    background: var(--accent-rose-soft);
}

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    padding-top: calc(1.5rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    pointer-events: auto;
    isolation: isolate;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}

.login-card {
    width: 100%;
    max-width: 360px;
    padding: 2rem 1.75rem;
    text-align: center;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.login-card p {
    font-size: 0.9rem;
    color: var(--chrome-400);
    margin-bottom: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pin-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 2.5rem;
    padding: 0.5rem 0;
}

.pin-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.pin-dot.is-filled {
    background: var(--chrome-100);
    border-color: var(--chrome-100);
    transform: scale(1.05);
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    touch-action: manipulation;
}

.pin-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1.15;
    min-height: 52px;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    background: rgba(255, 255, 255, 0.12);
    color: var(--chrome-100);
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    transition: transform 0.12s var(--ease-out), background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (hover: none) and (pointer: coarse) {
    body:not(.register-page) .login-card.glass-panel {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(18, 18, 28, 0.92);
    }

    .pin-key {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, 0.14);
    }
}

.pin-key:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

.pin-key:active {
    transform: scale(0.96);
}

.pin-key--action {
    font-size: 1.15rem;
    color: var(--chrome-400);
}

.pin-key--enter {
    aspect-ratio: auto;
    min-height: 52px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
}

.login-error {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--accent-rose);
    min-height: 1.25rem;
}

.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    isolation: isolate;
    touch-action: manipulation;
}

.auth-screen:not(.hidden) .auth-card {
    animation: authCardIn 0.55s var(--ease-out) both;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-screen:not(.hidden) .auth-card {
        animation: none;
    }
}

.auth-card {
    text-align: left;
    max-width: 380px;
}

.auth-card--wide {
    max-width: 440px;
}

.auth-card h1 {
    text-align: center;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.auth-card > p:not(.auth-hint):not(.login-error) {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field span {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--chrome-400);
}

.auth-field input,
.auth-field textarea {
    width: 100%;
    padding: 0.72rem 0.85rem;
    border-radius: var(--radius-btn);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: var(--chrome-100);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.auth-field input:focus,
.auth-field textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 3px rgba(232, 160, 176, 0.18);
}

.auth-gender {
    border: none;
    padding: 0;
    margin: 0.15rem 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.auth-gender legend {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--chrome-400);
    margin-bottom: 0.15rem;
}

.auth-gender__opt {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-btn);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.auth-gender__opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-gender__opt:has(input:checked) {
    border-color: var(--accent-rose-soft);
    background: rgba(232, 160, 176, 0.12);
    color: #fff;
}

.auth-gender__opt:active {
    transform: scale(0.98);
}

.auth-submit {
    width: 100%;
    margin-top: 0.35rem;
    white-space: nowrap;
}

.auth-link-btn {
    width: 100%;
    margin-top: 0.55rem;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--chrome-400);
}

.auth-hint {
    font-size: 0.82rem;
    color: var(--chrome-400);
    text-align: center;
    margin: 0.85rem 0 0;
    line-height: 1.45;
}

.auth-photo-field {
    margin-top: 0.15rem;
}

.auth-field--photo input[type="file"] {
    padding: 0.55rem 0.65rem;
    font-size: 0.82rem;
}

.auth-field--photo input[type="file"]::file-selector-button {
    margin-right: 0.65rem;
    border: 0;
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    background: rgba(255, 107, 129, 0.22);
    color: var(--chrome-100);
    font-family: inherit;
    cursor: pointer;
}

.room-code-display {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: clamp(1.15rem, 4.5vw, 1.55rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-align: center;
    padding: 1.1rem 0.85rem;
    margin: 0.25rem 0 0.85rem;
    border-radius: var(--radius-btn);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(0, 0, 0, 0.35);
    border: 1px dashed rgba(232, 160, 176, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    word-break: break-all;
    user-select: all;
}

.room-code-display.is-copied {
    border-color: var(--accent-rose-soft);
    color: var(--accent-rose-soft);
}

.invite-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 1rem 0;
    max-height: min(50vh, 320px);
    overflow-y: auto;
}

.invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}

.invite-row__name {
    font-weight: 500;
    font-size: 0.95rem;
}

.invite-row__actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.invite-row__actions .glass-btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    white-space: nowrap;
}

.setup-progress {
    display: flex;
    gap: 0.55rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.15rem;
}

.setup-chip {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.55;
}

.setup-chip.is-done {
    opacity: 1;
    border-color: var(--accent-rose-soft);
    color: var(--accent-rose-soft);
    background: rgba(232, 160, 176, 0.1);
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.88rem;
    line-height: 1.4;
    margin: 0.35rem 0 0.65rem;
    color: var(--chrome-400);
}

.guy-mood-fields {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

#roomPinScreen .login-card {
    text-align: center;
}

#roomPinScreen .login-card h1,
#roomPinScreen .login-card > p {
    text-align: center;
}
