/**
 * Estilos do Login - Sistema Flow
 * 
 * @author Flow System
 * @version 1.0.0
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.login-container {
    display: flex;
    height: 100vh;
    min-height: 600px;
}

/* Seção Esquerda - Branding */
.branding-section {
    flex: 1;
    background: linear-gradient(135deg, #2C5F7C 0%, #4A9B8E 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    min-width: 0;
}

/* Gradiente verde→laranja para homologação (invertido do original) */
body.env-homologacao .branding-section {
    background: linear-gradient(135deg, #4ECDC4 0%, #FFB84D 50%, #FF8C42 100%) !important;
}

.branding-content {
    text-align: center;
    color: white;
    z-index: 2;
}

.welcome-text {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    opacity: 0.95;
    text-align: center;
}

.flow-logo {
    margin-bottom: 0.5rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.flow-logo .logo-img {
    width: auto;
    height: 450px;
    object-fit: contain;
    object-position: center;
    transform: scale(1.2);
    margin: -25px 0;
}

.flow-subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 3rem;
    text-align: left;
    margin-left: 61px;
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.developer-info {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.developer-info span {
    font-weight: 500;
}

.techone-logo {
    width: 237px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.techone-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Seção Direita - Formulário */
.form-section {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    min-width: 0;
}

.form-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.app-logo {
    width: 140px;
    height: 134px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.password-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.password-toggle:hover {
    opacity: 1;
}

.eye-icon {
    display: inline-block;
    user-select: none;
}

.form-input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: none;
    border-radius: 12px;
    background: #F0EDE6;
    font-size: 1rem;
    color: #2C3E50;
    transition: all 0.3s ease;
    outline: none;
}

.password-group .form-input {
    padding-right: 3.5rem;
}

.form-input:focus {
    background: #E8E4D8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 124, 0.15);
}

.form-input::placeholder {
    color: #7F8C8D;
    font-weight: 500;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(90deg, #2C5F7C 0%, #4A9B8E 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 95, 124, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.forgot-password {
    color: #7F8C8D;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #2C5F7C;
}

.copyright {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    color: #7F8C8D;
    font-size: 0.8rem;
}

/* reCAPTCHA Styles */
.g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.g-recaptcha > div {
    transform: scale(0.9);
    transform-origin: center;
}

/* Token Modal Styles */
.token-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.token-modal-content {
    background: white;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
    position: relative;
}

.token-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.token-modal-close:hover {
    background: #f0f0f0;
    color: #2C5F7C;
    transform: rotate(90deg);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.token-modal-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.token-modal-header h2 {
    color: #2C5F7C;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.token-modal-header p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.token-inputs {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
}

.token-digit {
    width: 55px;
    height: 65px;
    border: 2px solid #ddd;
    border-radius: 12px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #2C5F7C;
    transition: all 0.3s ease;
    outline: none;
    flex-shrink: 0;
}

.token-digit:focus {
    border-color: #4A9B8E;
    box-shadow: 0 0 0 3px rgba(74, 155, 142, 0.1);
    transform: scale(1.05);
}

.token-digit:hover {
    border-color: #4A9B8E;
}

.token-error {
    background: #fee;
    color: #c33;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.token-verify-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2C5F7C 0%, #4A9B8E 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.token-verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 95, 124, 0.3);
}

.token-resend {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.token-resend a {
    color: #2C5F7C;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.token-resend a:hover {
    color: #4A9B8E;
    text-decoration: underline;
}

/* Responsividade */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: 100vh;
        overflow-y: auto;
    }
    
    .token-modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
    }
    
    .token-inputs {
        gap: 0.4rem;
    }
    
    .token-digit {
        width: 45px;
        height: 55px;
        font-size: 1.5rem;
    }
    
    .branding-section {
        flex: 0 0 40vh;
        min-height: 300px;
        padding: 1.5rem;
    }
    
    .welcome-text {
        font-size: 2.5rem;
        margin-top: 2rem;
    }
    
    .flow-logo {
        height: 120px;
    }
    
    .flow-logo .logo-img {
        height: 150px;
        transform: scale(1.1);
    }
    
    .flow-subtitle {
        font-size: 0.8rem;
        margin-bottom: 2rem;
        text-align: left;
        margin-left: 0;
    }
    
    .developer-info {
        position: static;
        justify-content: center;
        margin-top: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .techone-logo {
        width: 150px;
        height: 58px;
    }
    
    .techone-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .form-section {
        flex: 1;
        padding: 2rem 1.5rem;
        justify-content: flex-start;
        padding-top: 3rem;
    }
    
    .form-container {
        max-width: 100%;
    }
    
    .app-logo {
        width: 80px;
        height: 76px;
        margin-bottom: 1.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .form-input {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
    
    .login-button {
        padding: 0.9rem;
        font-size: 1rem;
    }
    
    .copyright {
        position: static;
        text-align: center;
        margin-top: 2rem;
    }
}

@media (max-width: 480px) {
    .token-modal-content {
        width: 98%;
        padding: 1.5rem 1rem;
    }
    
    .token-modal-header h2 {
        font-size: 1.3rem;
    }
    
    .token-modal-header p {
        font-size: 0.85rem;
    }
    
    .token-inputs {
        gap: 0.3rem;
    }
    
    .token-digit {
        width: 40px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .token-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 30px;
        height: 30px;
        font-size: 1.5rem;
    }
    
    .branding-section {
        flex: 0 0 35vh;
        min-height: 300px;
        padding: 1.5rem 1rem;
    }
    
    .welcome-text {
        font-size: 2rem;
        margin-top: 1.5rem;
    }
    
    .flow-logo {
        height: 80px;
    }
    
    .flow-logo .logo-img {
        height: 185px;
        transform: scale(1.1);
    }
    
    .flow-subtitle {
        font-size: 0.7rem;
        margin-bottom: 1.5rem;
        text-align: center;
        display: flex;
        justify-content: center;
        margin-left: 0;
    }
    
    .form-section {
        padding: 1.5rem 1rem;
        padding-top: 2rem;
    }
    
    .app-logo {
        width: 60px;
        height: 57px;
    }
    
    .techone-logo {
        width: 120px;
        height: 46px;
    }
    
    .techone-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .form-input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .login-button {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.branding-content {
    animation: fadeInUp 0.8s ease-out;
}

.form-container {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Estados de erro */
.form-input.error {
    background: #FDF2F2;
    border: 2px solid #F56565;
}

.error-message {
    color: #F56565;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: left;
}

/* Loading state */
.login-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-button.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para ambiente de homologação - Gradiente Verde→Laranja (invertido do original) */
body.env-homologacao .login-button {
    background: linear-gradient(90deg, #4ECDC4 0%, #FFB84D 50%, #FF8C42 100%);
}

body.env-homologacao .login-button:hover {
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.3);
}

body.env-homologacao .forgot-password:hover {
    color: #FF8C42;
}

body.env-homologacao .token-modal-close:hover {
    color: #FF8C42;
}

body.env-homologacao .token-modal-header h2 {
    color: #FF8C42;
}

body.env-homologacao .token-digit {
    color: #FF8C42;
}

body.env-homologacao .token-digit:focus,
body.env-homologacao .token-digit:hover {
    border-color: #4ECDC4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

body.env-homologacao .token-verify-btn {
    background: linear-gradient(135deg, #4ECDC4 0%, #FFB84D 50%, #FF8C42 100%);
}
