/* =====================================================
   CSS PARA AUTENTICAÇÃO SAAS - DESIGN MODERNO
   Baseado no design Flow Pages
   ===================================================== */

:root {
    /* Cores do tema claro */
    --bg-dark: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    /* Cores azuis (tema principal) */
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-blue-light: #3b82f6;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

/* Container Principal - Layout Dividido */
.login-page {
    min-height: 100vh;
    background: var(--bg-dark);
    display: flex;
}

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* =====================================================
   LADO ESQUERDO - MARKETING
   ===================================================== */
.login-marketing {
    flex: 1;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.marketing-content {
    max-width: 600px;
    width: 100%;
}

/* Logo */
.marketing-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.marketing-logo .logo-img {
    max-height: 44px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}

.marketing-logo .logo-fallback {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-hover) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Título Principal */
.marketing-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.title-highlight {
    color: var(--accent-blue);
}

/* Descrição */
.marketing-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

/* Botões de Marketing */
.marketing-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn-marketing {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-primary-marketing {
    background: var(--accent-blue);
    color: white;
}

.btn-primary-marketing:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
}

.btn-outline-marketing {
    background: transparent;
    color: var(--accent-blue);
    border: 2px solid var(--accent-blue);
}

.btn-outline-marketing:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* Recursos */
.marketing-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.feature-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* =====================================================
   LADO DIREITO - FORMULÁRIO DE LOGIN
   ===================================================== */
.login-form-container {
    flex: 0 0 500px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

/* Header do Formulário */
.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Mensagens */
.auth-message {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: none;
}

.auth-message.show {
    display: block;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Formulário */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.form-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
    display: block;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 0.125rem;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Input de Senha com Toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--accent-blue);
}

.password-toggle .eye-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Botão de Login */
.btn-login {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.btn-login:hover:not(:disabled) {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-login .btn-text {
    position: relative;
    z-index: 1;
}

.btn-login .btn-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.btn-login:disabled .btn-text {
    opacity: 0;
}

.btn-login:disabled .btn-loading {
    display: block;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Link Esqueceu Senha */
.forgot-password-link {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-password-link a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link a:hover {
    color: var(--accent-blue);
}

.forgot-password-link p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.forgot-password-link p a {
    color: var(--accent-blue);
    font-weight: 500;
}

/* =====================================================
   RESPONSIVIDADE
   ===================================================== */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }

    .login-marketing {
        padding: 2rem;
        min-height: auto;
    }

    .marketing-title {
        font-size: 2.25rem;
    }

    .marketing-features {
        grid-template-columns: 1fr;
    }

    .login-form-container {
        flex: 1;
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .login-marketing {
        padding: 1.5rem;
    }

    .marketing-title {
        font-size: 1.75rem;
    }

    .marketing-description {
        font-size: 1rem;
    }

    .marketing-buttons {
        flex-direction: column;
    }

    .btn-marketing {
        width: 100%;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }
}

/* =====================================================
   ESTILOS COMPATIBILIDADE (para outras páginas)
   ===================================================== */

/* Input com ícone (para página de cadastro) */
.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
    z-index: 1;
    flex-shrink: 0;
}

.input-with-icon input {
    padding-left: 2.75rem;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 1rem;
}

.auth-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: white;
    color: #1e293b;
}

/* Ajuste para inputs com ícone na página de cadastro */
.auth-page .input-with-icon {
    position: relative;
}

.auth-page .input-with-icon .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    color: #64748b;
    pointer-events: none;
    z-index: 1;
    flex-shrink: 0;
}

.auth-page .input-with-icon .input-icon svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
}

.auth-page .input-with-icon input {
    padding-left: 2.75rem;
}

/* Indicador de força de senha */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: #10b981;
}

/* Preview e validação de subdomínio */
.subdomain-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #64748b;
}

.subdomain-preview .subdomain-value {
    font-weight: 600;
    color: #2563eb;
}

.subdomain-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
}

.subdomain-check.available {
    color: #10b981;
}

.subdomain-check.unavailable {
    color: #ef4444;
}

.subdomain-check.loading {
    color: #64748b;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #eff6ff;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.auth-footer p {
    color: #64748b;
    font-size: 0.875rem;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   FORMULÁRIO MULTI-STEP
   ===================================================== */

/* Barra de Progresso */
.progress-container {
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s;
    border: 2px solid #e2e8f0;
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    font-weight: 500;
    transition: color 0.3s;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.progress-step.active .step-label {
    color: #2563eb;
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.progress-step.completed .step-label {
    color: #10b981;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.5rem;
    margin-top: -18px;
    position: relative;
    z-index: 1;
    transition: background 0.3s;
}

.progress-line.completed {
    background: #10b981;
}

/* Formulário Multi-Step */
.multi-step-form {
    position: relative;
    min-height: 300px;
}

.login-form.multi-step-form {
    gap: 1.5rem;
}

.form-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.step-description {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.step-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.step-actions .btn-login {
    margin-top: 0;
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: white;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-next {
    flex: 1;
}

/* Seção de Revisão */
.review-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.review-section h3 {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    color: #1e293b;
    font-weight: 600;
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.review-item:last-child {
    border-bottom: none;
}

.review-item strong {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.875rem;
}

.review-item span {
    color: #64748b;
    font-size: 0.875rem;
    text-align: right;
}

/* Input com erro */
.form-group input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Responsividade */
@media (max-width: 640px) {
    .progress-steps {
        padding: 0 0.5rem;
    }

    .step-label {
        font-size: 0.6875rem;
        display: none;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    .progress-line {
        margin-top: -16px;
    }

    .step-title {
        font-size: 1.25rem;
    }

    .step-actions {
        flex-direction: column;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
    }
}
