/**
 * TECHFLIX Login Form Styles
 *
 * Estilos base para o formulário de login
 * Customizações podem ser feitas via Elementor
 *
 * @package TECHFLIX
 * @since 1.8.0
 */

/* ==========================================================================
   Reset e Base
   ========================================================================== */

.techflix-login-form-wrap {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.techflix-login-form-wrap * {
    box-sizing: border-box;
}

/* ==========================================================================
   Formulário
   ========================================================================== */

.techflix-login-form {
    display: flex;
    flex-direction: column;
}

.techflix-login-form.techflix-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ==========================================================================
   Campos de Entrada
   ========================================================================== */

.techflix-field-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.techflix-field-label {
    display: block;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.techflix-field {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.techflix-field:focus {
    outline: none;
    border-color: #e50914;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.techflix-field:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.techflix-field::placeholder {
    color: #999;
}

/* Campo de Senha com Toggle */
.techflix-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.techflix-password-wrapper .techflix-field {
    padding-right: 48px;
}

.techflix-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    padding: 4px;
    cursor: pointer;
    color: #888 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    opacity: 0.6;
}

.techflix-toggle-password:hover,
.techflix-toggle-password:focus,
.techflix-toggle-password:active {
    opacity: 1;
    background: none !important;
    border: none !important;
    color: #888 !important;
    outline: none !important;
    box-shadow: none !important;
}

.techflix-toggle-password svg,
.techflix-toggle-password span {
    color: inherit !important;
    fill: currentColor !important;
}

.techflix-toggle-password svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.techflix-eye-icon,
.techflix-eye-off-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.techflix-eye-off-icon {
    display: none;
}

/* ==========================================================================
   Loader (Estilo PowerPack - sem overlay HTML)
   ========================================================================== */

.techflix-login-form-wrap {
    position: relative;
    --techflix-spinner-color: #e50914;
}

/* Esconde o overlay HTML antigo (mantido para compatibilidade) */
.techflix-form-overlay {
    display: none !important;
}

/* Formulário fica semi-transparente quando carregando */
.techflix-login-form-wrap.techflix-loading .techflix-login-form {
    pointer-events: none;
    opacity: 0.25;
}

/* Spinner via pseudo-elemento ::before (trilha de fundo) */
.techflix-login-form-wrap.techflix-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    z-index: 100;
    border-radius: 50%;
    border: 4px solid #e5e5e5;
    border-top-color: var(--techflix-spinner-color);
    animation: techflix-spin 0.8s linear infinite;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.techflix-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.techflix-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 360px;
    pointer-events: auto;
    animation: techflix-toast-in 0.3s ease;
}

.techflix-toast.techflix-toast-out {
    animation: techflix-toast-out 0.3s ease forwards;
}

.techflix-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.techflix-toast-error .techflix-toast-icon {
    background: #fef2f2;
    color: #dc2626;
}

.techflix-toast-success .techflix-toast-icon {
    background: #f0fdf4;
    color: #16a34a;
}

.techflix-toast-icon svg {
    width: 16px;
    height: 16px;
}

.techflix-toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.techflix-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #999;
    transition: background 0.2s ease, color 0.2s ease;
}

.techflix-toast-close:hover {
    background: #f5f5f5;
    color: #333;
}

.techflix-toast-close svg {
    width: 16px;
    height: 16px;
}

@keyframes techflix-toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes techflix-toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ==========================================================================
   Remember Me
   ========================================================================== */

.techflix-field-remember {
    /* Espaçamento controlado via Elementor */
}

.techflix-remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.techflix-remember-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #16a34a;
    flex-shrink: 0;
}

.techflix-remember-label span {
    font-size: 14px;
    color: #666;
}

/* ==========================================================================
   Botão de Submit
   ========================================================================== */

.techflix-login-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #e50914;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    min-height: 48px;
}

.techflix-login-button:hover {
    background-color: #b20710;
}

.techflix-login-button:active {
    transform: scale(0.98);
}

.techflix-login-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.3);
}

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

.techflix-button-text {
    transition: visibility 0.1s ease;
}

/* Loading Spinner */
.techflix-button-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.techflix-button-loading .techflix-button-loader {
    display: block;
}

.techflix-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: techflix-spin 0.8s linear infinite;
}

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

/* Tamanhos de Botão */
.techflix-button-size-xs .techflix-login-button {
    padding: 8px 16px;
    font-size: 12px;
    min-height: 32px;
}

.techflix-button-size-sm .techflix-login-button {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 40px;
}

.techflix-button-size-md .techflix-login-button {
    padding: 14px 24px;
    font-size: 16px;
    min-height: 48px;
}

.techflix-button-size-lg .techflix-login-button {
    padding: 18px 32px;
    font-size: 18px;
    min-height: 56px;
}

.techflix-button-size-xl .techflix-login-button {
    padding: 22px 40px;
    font-size: 20px;
    min-height: 64px;
}

/* ==========================================================================
   Mensagens
   ========================================================================== */

.techflix-login-message {
    display: none;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    margin-bottom: 10px;
}

.techflix-login-message.techflix-login-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.techflix-login-message.techflix-login-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* ==========================================================================
   Links
   ========================================================================== */

.techflix-form-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    margin-top: 10px;
}

.techflix-lost-password-link,
.techflix-register-link,
.techflix-back-to-login {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.techflix-lost-password-link:hover,
.techflix-register-link:hover,
.techflix-back-to-login:hover {
    color: #e50914;
    text-decoration: underline;
}

/* ==========================================================================
   Separador
   ========================================================================== */

.techflix-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 10px 0;
}

.techflix-separator::before,
.techflix-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #ddd;
}

.techflix-separator span {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

/* ==========================================================================
   Formulário de Recuperação de Senha
   ========================================================================== */

.techflix-lost-password-form,
.techflix-reset-password-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.techflix-lost-password-text,
.techflix-reset-password-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    text-align: center;
}

/* ==========================================================================
   Requisitos de Senha
   ========================================================================== */

.techflix-password-requirements {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ==========================================================================
   Indicador de Força de Senha
   ========================================================================== */

.techflix-password-strength {
    margin-top: 8px;
}

.techflix-password-strength-bar {
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.techflix-password-strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.techflix-password-strength-text {
    font-size: 12px;
    margin-top: 4px;
}

.techflix-strength-weak .techflix-password-strength-fill {
    width: 25%;
    background-color: #dc2626;
}

.techflix-strength-fair .techflix-password-strength-fill {
    width: 50%;
    background-color: #f59e0b;
}

.techflix-strength-good .techflix-password-strength-fill {
    width: 75%;
    background-color: #3b82f6;
}

.techflix-strength-strong .techflix-password-strength-fill {
    width: 100%;
    background-color: #16a34a;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 480px) {
    .techflix-login-form-wrap {
        padding: 0 16px;
    }

    .techflix-field {
        padding: 10px 14px;
        font-size: 16px; /* Previne zoom no iOS */
    }

    .techflix-login-button {
        padding: 12px 20px;
    }
}

/* ==========================================================================
   Estados de Foco para Acessibilidade
   ========================================================================== */

.techflix-login-form-wrap .techflix-field:focus-visible,
.techflix-login-form-wrap .techflix-login-button:focus-visible {
    outline: none;
}

/* Remove qualquer borda/outline do botão em todos os estados */
.techflix-login-form-wrap .techflix-login-button:focus,
.techflix-login-form-wrap .techflix-login-button:active,
.techflix-login-form-wrap .techflix-login-button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
}

/* ==========================================================================
   Modo Escuro (opcional - pode ser ativado via Elementor)
   ========================================================================== */

.techflix-dark-mode .techflix-login-form-wrap {
    --tf-text-color: #fff;
    --tf-bg-color: #141414;
    --tf-border-color: #333;
    --tf-input-bg: #222;
}

.techflix-dark-mode .techflix-label {
    color: var(--tf-text-color);
}

.techflix-dark-mode .techflix-field {
    background-color: var(--tf-input-bg);
    border-color: var(--tf-border-color);
    color: var(--tf-text-color);
}

.techflix-dark-mode .techflix-field::placeholder {
    color: #666;
}

.techflix-dark-mode .techflix-remember-me label {
    color: #999;
}

.techflix-dark-mode .techflix-lost-password-link,
.techflix-dark-mode .techflix-register-link,
.techflix-dark-mode .techflix-back-to-login {
    color: #999;
}

.techflix-dark-mode .techflix-separator span {
    color: #666;
}

.techflix-dark-mode .techflix-separator::before,
.techflix-dark-mode .techflix-separator::after {
    background-color: #333;
}

/* ==========================================================================
   Animações de Entrada
   ========================================================================== */

.techflix-login-form-wrap {
    animation: techflix-fadeIn 0.3s ease;
}

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

/* Transição suave entre formulários */
.techflix-form-transition {
    animation: techflix-slideIn 0.3s ease;
}

@keyframes techflix-slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
