/* Customer direct-contact — auth + chat layout */

.customer-page .container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

body.has-app-bottom-nav #chatSection .chat-container {
    height: calc(100vh - 56px - var(--app-nav-height, 56px) - env(safe-area-inset-bottom, 0px));
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
}

.auth-toggle button {
    background: none;
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    padding: 4px 8px;
}

.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.auth-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 28px 24px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 400px;
}

@media (min-width: 768px) {
    .auth-card {
        padding: 32px 28px;
    }
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    color: var(--text);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

.auth-required-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 auto 20px;
    border: 1px solid rgba(0, 229, 255, 0.25);
}

.auth-card h2 {
    margin-bottom: 20px;
    color: var(--text);
}

.error-text {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 6px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.chat-header {
    padding: 14px 16px;
    background: var(--bg-glass);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-header-info {
    flex: 1;
}

.chat-header-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.chat-header-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
}

.chat-msg {
    max-width: 85%;
    align-self: flex-start;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.chat-msg.user {
    background: var(--primary);
    color: var(--bg);
    align-self: flex-end;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

.chat-msg.admin {
    background: var(--bg-glass);
    color: var(--text);
    border: 1px solid var(--border);
}

.chat-msg-time {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 4px;
}

.chat-msg.user .chat-msg-time {
    text-align: right;
}

.chat-input-area {
    padding: 12px 16px;
    background: var(--bg-glass);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-input-wrap {
    flex: 1;
}

.chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text);
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-fast);
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.blocked-notice {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    text-align: center;
    border-radius: var(--radius-md);
    margin: 10px 16px;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.empty-chat {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-chat i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    color: var(--primary);
}

.customer-page .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
    box-shadow: none;
}

.customer-page .loading-spinner::before,
.customer-page .loading-spinner::after {
    display: none;
}
