/* Chat Magazine Luiza - Estilos Modernos */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #0066CC;
    --color-primary-dark: #004499;
    --color-primary-light: #3399FF;
    --color-primary-lighter: #B3D9FF;
    --color-secondary: #3399FF;
    --color-bg: #F5F5F5;
    --color-white: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-lighter: #999999;
    --color-border: #E0E0E0;
    --color-success: #00C853;
    --color-error: #FF1744;
    --color-warning: #FF9800;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0066CC 0%, #3399FF 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--color-text);
}

.chat-container {
    width: 100%;
    max-width: 480px;
    height: 90vh;
    max-height: 800px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 20px;
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.header-info h1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--color-white);
    border-radius: 50%;
    color: var(--color-primary);
    font-size: 11px;
    font-weight: bold;
    margin-left: 4px;
    flex-shrink: 0;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.logo {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    padding: 4px;
    overflow: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.header-info h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--color-white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages[style*="display: none"] {
    display: none !important;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-lighter);
}

/* Welcome Message */
.welcome-message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.message-content {
    flex: 1;
}

.message-text {
    background: var(--color-white);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    margin-bottom: 4px;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    color: var(--color-text-lighter);
    padding-left: 4px;
}

/* User Message */
.message-user {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    animation: slideIn 0.3s ease;
}

.message-user .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 75%;
}

.message-user .message-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    border-radius: var(--radius-md) var(--radius-md) var(--radius-sm) var(--radius-md);
}

.message-user .message-time {
    text-align: right;
    padding-right: 4px;
}

/* Bot Message */
.message-bot {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.message-bot .message-content {
    max-width: 75%;
}

.message-bot .message-text {
    background: var(--color-white);
    border-radius: var(--radius-md) var(--radius-md) var(--radius-md) var(--radius-sm);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
    font-size: 12px;
    color: var(--color-text);
    font-weight: 500;
}

.quick-btn:hover {
    background: var(--color-primary-lighter);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-btn .icon {
    font-size: 20px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 12px 20px;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    align-items: center;
    gap: 12px;
}

.typing-indicator.active {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-indicator p {
    font-size: 12px;
    color: var(--color-text-light);
}

/* Input Area */
.chat-input-area {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 16px 20px;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    padding: 8px 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 153, 0.1);
}

.btn-attach,
.btn-send {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-attach:hover,
.btn-send:hover {
    background: var(--color-primary-lighter);
    color: var(--color-primary);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    font-family: inherit;
    resize: none;
    max-height: 120px;
}

.message-input::placeholder {
    color: var(--color-text-lighter);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--color-text-lighter);
}

.char-count {
    font-weight: 500;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--color-white);
    font-weight: 500;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text);
    color: var(--color-white);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-error);
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .quick-actions {
        padding: 10px 16px;
    }
    
    .quick-btn {
        min-width: 70px;
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .chat-messages {
        padding: 20px 16px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.message-user,
.message-bot {
    animation: fadeIn 0.3s ease;
}

/* Card Styles for Information */
.info-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 8px 0;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
}

.info-card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 8px;
}

.info-card-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.info-card-label {
    font-size: 12px;
    color: var(--color-text-light);
}

/* Summary Card */
.summary-card {
    border-left: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.summary-icon {
    font-size: 20px;
}

.summary-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.summary-subtitle {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.summary-total {
    font-size: 12px;
    color: var(--color-text-lighter);
}

/* Invoice Card */
.invoice-card {
    border-left: none;
    background: var(--color-white);
    border: 1px solid var(--color-border);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.invoice-status {
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text);
    text-transform: capitalize;
}

.invoice-status.fechada {
    color: var(--color-primary);
}

.invoice-date {
    font-size: 12px;
    color: var(--color-text-light);
}

.invoice-values {
    margin-bottom: 16px;
}

.invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.invoice-label {
    font-size: 14px;
    color: var(--color-text);
}

.invoice-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.invoice-resumo {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.resumo-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 12px;
}

.resumo-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--color-text-light);
}

/* Limit Card with Circle */
.limit-card {
    border-left: none;
    background: var(--color-white);
    border: 1px solid var(--color-border);
}

.limit-circle-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.limit-circle {
    width: 120px;
    height: 120px;
    position: relative;
    flex-shrink: 0;
}

.limit-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    position: absolute;
    top: 0;
    left: 0;
}

.limit-circle-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.limit-circle-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.limit-circle-label {
    font-size: 10px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.limit-info {
    flex: 1;
    min-width: 150px;
}

.limit-info-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.limit-info-item span {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.limit-info-item strong {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.limit-fatura,
.limit-dates {
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
    font-size: 13px;
    color: var(--color-text-light);
    line-height: 1.6;
}

.limit-fatura div:first-child,
.limit-dates div:first-child {
    margin-bottom: 4px;
}

/* Timeline Card */
.timeline-card {
    border-left: none;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 0;
}

.timeline-item {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-lighter);
    text-transform: lowercase;
    margin-bottom: 12px;
}

.timeline-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.timeline-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.timeline-text {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 4px;
}

.timeline-subtitle {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.timeline-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 4px;
}

/* Login Form */
.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--color-bg);
}

.login-form {
    width: 100%;
    max-width: 420px;
    background: var(--color-white);
    padding: 50px 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 28px;
}

.form-group:last-of-type {
    margin-bottom: 32px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 10px;
    text-transform: lowercase;
    letter-spacing: 0.2px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #D0D0D0;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-white);
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #999999;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.form-input::placeholder {
    color: #B0B0B0;
    font-weight: 300;
}

.form-input.error {
    border-color: #FF3333 !important;
    background-color: #FFF5F5 !important;
}

.error-message {
    display: block !important;
    color: #FF3333 !important;
    font-size: 13px !important;
    margin-top: 6px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}

.btn-acessar {
    width: 100%;
    padding: 16px 24px;
    background: #E8E8E8;
    color: #666666;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 400;
    font-family: inherit;
    cursor: not-allowed;
    transition: all 0.2s ease;
    text-transform: lowercase;
    letter-spacing: 0.3px;
    opacity: 0.6;
}

.btn-acessar:hover:not(:disabled) {
    background: #0055AA;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-acessar:active:not(:disabled) {
    background: #004499;
    transform: scale(0.98);
}

.btn-acessar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #E8E8E8;
    color: #666666;
}

/* Loading Screen */
.loading-screen {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 40px 20px;
    background: linear-gradient(135deg, #0066CC 0%, #3399FF 100%);
    position: relative;
}

.loading-content {
    text-align: left;
    color: white;
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 20px;
    padding-left: 20px;
}

.btn-close-loading {
    position: absolute;
    top: -20px;
    right: -20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-close-loading:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.loading-name {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 0;
    margin-top: 0;
    color: white;
    text-align: left;
    padding-left: 0;
    min-height: 40px;
    display: block;
    order: 1;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    order: 2;
    margin-top: 120px;
    padding-left: 0;
    width: 100%;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Second Step Form */
.second-step-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--color-bg);
}

/* Responsive adjustments for cards */
@media (max-width: 480px) {
    .limit-circle-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .limit-info {
        width: 100%;
    }
    
    .summary-value {
        font-size: 20px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .loading-name {
        font-size: 24px;
        padding-left: 10px;
    }
}
