/* Reset e Base - Estilo Login ChatBot Pro */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00f5ff;
    --secondary-color: #ff006e;
    --accent-color: #8338ec;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --gradient-1: linear-gradient(135deg, #00f5ff, #8338ec);
    --gradient-2: linear-gradient(135deg, #ff006e, #00f5ff);
    --gradient-3: linear-gradient(135deg, #8338ec, #ff006e);
    --success-color: #00ff88;
    --error-color: #ff4444;
    --warning-color: #ffaa00;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background sutil para login */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 245, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 110, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(131, 56, 236, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: subtlePulse 12s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* Grid sutil de fundo */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 245, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.05) 1px, transparent 1px);
    background-size: 80px 80px;
    z-index: -1;
    animation: gridMove 30s linear infinite;
    opacity: 0.3;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(80px, 80px); }
}

/* Container de Login */
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Card de Login */
.login-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 3rem 2.5rem;
    border: 1px solid rgba(0, 245, 255, 0.2);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 245, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    border-radius: 25px 25px 0 0;
}

.login-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 245, 255, 0.2);
}

/* Título */
.login-card h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-error {
    background: rgba(255, 68, 68, 0.15);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Form Group */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Form Control */
.form-control {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 1px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 
        0 0 25px rgba(0, 245, 255, 0.3),
        inset 0 0 20px rgba(0, 245, 255, 0.1);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.form-control:hover {
    border-color: rgba(0, 245, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-gray);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-1);
    color: var(--bg-dark);
    box-shadow: 0 8px 25px rgba(0, 245, 255, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 245, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* Text Center */
.text-center {
    text-align: center;
}

/* Margin Top */
.mt-3 {
    margin-top: 1.5rem;
}

/* Texto de rodapé */
.login-card p {
    margin: 0;
    line-height: 1.5;
}

/* Animação de entrada do card */
.login-card {
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Efeito de digitação no input */
.form-control {
    position: relative;
}

.form-control:focus::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-1);
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

/* Loading state para o botão */
.btn.loading {
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--text-light);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-card h2 {
        font-size: 1.8rem;
    }
    
    .form-control {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

/* Efeitos visuais adicionais */
.login-card {
    position: relative;
}

.login-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-1);
    border-radius: 25px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-card:hover::after {
    opacity: 0.1;
}

/* Estilo para o input de chave em maiúsculas */
#client_key {
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 2px;
}

/* Placeholder animado */
.form-group {
    position: relative;
}

.form-group label {
    transition: all 0.3s ease;
}

.form-control:focus + label,
.form-control:not(:placeholder-shown) + label {
    transform: translateY(-25px) scale(0.85);
    color: var(--primary-color);
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}