/**
 * Newsletter Manager - Estilos
 * Versão: 1.0.0
 */

/* ========================================
   RESET E VARIÁVEIS
======================================== */

:root {
    --nm-primary: #2271b1;
    --nm-primary-hover: #135e96;
    --nm-secondary: #6c757d;
    --nm-secondary-hover: #5a6268;
    --nm-success: #28a745;
    --nm-danger: #dc3545;
    --nm-warning: #ffc107;
    --nm-light: #f8f9fa;
    --nm-dark: #212529;
    --nm-border: #dee2e6;
    --nm-radius: 8px;
    --nm-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --nm-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ========================================
   CONTAINER E LAYOUT
======================================== */

.nm-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 0 20px;
}

.nm-form-wrapper {
    background: #fff;
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
    padding: 40px;
}

.nm-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.nm-form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--nm-dark);
    margin: 0 0 10px;
}

.nm-form-header p {
    font-size: 14px;
    color: var(--nm-secondary);
    margin: 0;
}

/* ========================================
   FORMULÁRIOS
======================================== */

.nm-form {
    width: 100%;
}

.nm-form-group {
    margin-bottom: 20px;
}

.nm-form-group label {
    display: block;
    font-weight: 600;
    color: var(--nm-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.nm-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.nm-input:focus {
    outline: none;
    border-color: var(--nm-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.nm-input::placeholder {
    color: #999;
}

.nm-help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--nm-secondary);
}

/* ========================================
   CHECKBOX
======================================== */

.nm-checkbox-group {
    margin: 15px 0;
}

.nm-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
}

.nm-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* ========================================
   BOTÕES
======================================== */

.nm-button {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--nm-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.nm-button-primary {
    background: var(--nm-primary);
    color: #fff;
}

.nm-button-primary:hover {
    background: var(--nm-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--nm-shadow);
}

.nm-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.nm-button-secondary {
    background: var(--nm-secondary);
    color: #fff;
}

.nm-button-secondary:hover {
    background: var(--nm-secondary-hover);
}

.nm-button-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ========================================
   SPINNER
======================================== */

.nm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nm-spin 0.8s linear infinite;
}

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

/* ========================================
   MENSAGENS
======================================== */

.nm-form-messages {
    margin-bottom: 20px;
}

.nm-message {
    padding: 12px 16px;
    border-radius: var(--nm-radius);
    font-size: 14px;
    margin-bottom: 10px;
}

.nm-message:last-child {
    margin-bottom: 0;
}

.nm-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.nm-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   LINKS
======================================== */

.nm-form-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.nm-link {
    color: var(--nm-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nm-link:hover {
    color: var(--nm-primary-hover);
    text-decoration: underline;
}

.nm-separator {
    margin: 0 10px;
    color: var(--nm-border);
}

/* ========================================
   DASHBOARD
======================================== */

.nm-dashboard-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.nm-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.nm-dashboard-welcome h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--nm-dark);
    margin: 0 0 5px;
}

.nm-dashboard-welcome p {
    font-size: 16px;
    color: var(--nm-secondary);
    margin: 0;
}

.nm-dashboard-actions .nm-button {
    width: auto;
    padding: 10px 20px;
}

/* ========================================
   CARDS DO DASHBOARD
======================================== */

.nm-dashboard-content {
    display: grid;
    gap: 24px;
}

.nm-dashboard-card {
    background: #fff;
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
    overflow: hidden;
}

.nm-card-header {
    padding: 24px;
    border-bottom: 1px solid var(--nm-border);
}

.nm-card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--nm-dark);
    margin: 0 0 5px;
}

.nm-card-description {
    font-size: 14px;
    color: var(--nm-secondary);
    margin: 5px 0 0;
}

.nm-card-body {
    padding: 24px;
}

/* ========================================
   INFORMAÇÕES DA CONTA
======================================== */

.nm-info-grid {
    display: grid;
    gap: 16px;
}

.nm-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--nm-light);
    border-radius: 6px;
}

.nm-info-label {
    font-weight: 600;
    color: var(--nm-dark);
}

.nm-info-value {
    color: var(--nm-secondary);
}

/* ========================================
   CATEGORIAS
======================================== */

.nm-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.nm-category-item {
    border: 2px solid var(--nm-border);
    border-radius: var(--nm-radius);
    transition: all 0.3s ease;
    overflow: hidden;
}

.nm-category-item:hover {
    border-color: var(--nm-primary);
    box-shadow: var(--nm-shadow);
}

.nm-category-item.nm-category-selected {
    border-color: var(--nm-primary);
    background: rgba(34, 113, 177, 0.05);
}

.nm-category-label {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    cursor: pointer;
    margin: 0;
}

.nm-category-label input[type="checkbox"] {
    display: none;
}

.nm-category-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--nm-border);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.nm-category-label input[type="checkbox"]:checked + .nm-category-checkbox {
    background: var(--nm-primary);
    border-color: var(--nm-primary);
}

.nm-category-label input[type="checkbox"]:checked + .nm-category-checkbox::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.nm-category-content {
    flex: 1;
}

.nm-category-name {
    display: block;
    font-weight: 600;
    color: var(--nm-dark);
    margin-bottom: 4px;
}

.nm-category-description {
    display: block;
    font-size: 13px;
    color: var(--nm-secondary);
    line-height: 1.4;
}

/* ========================================
   ESTATÍSTICAS
======================================== */

.nm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.nm-stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--nm-light);
    border-radius: var(--nm-radius);
}

.nm-stat-icon {
    font-size: 36px;
}

.nm-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--nm-primary);
    line-height: 1;
}

.nm-stat-label {
    font-size: 14px;
    color: var(--nm-secondary);
    margin-top: 4px;
}

/* ========================================
   ESTADO VAZIO
======================================== */

.nm-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--nm-secondary);
}

/* ========================================
   AÇÕES DO FORMULÁRIO
======================================== */

.nm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   RESPONSIVIDADE
======================================== */

@media (max-width: 768px) {
    .nm-container {
        margin: 20px auto;
    }
    
    .nm-form-wrapper {
        padding: 24px;
    }
    
    .nm-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nm-dashboard-welcome h2 {
        font-size: 24px;
    }
    
    .nm-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .nm-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nm-form-actions {
        flex-direction: column;
    }
    
    .nm-form-actions .nm-button {
        width: 100%;
    }
}

/* ========================================
   INTEGRAÇÃO FLUENT FORMS
======================================== */

.nm-fluent-form .ff-el-form-control {
    padding: 12px 16px;
    border-radius: var(--nm-radius);
    border-color: var(--nm-border);
}

.nm-fluent-form .ff-btn-submit {
    background: var(--nm-primary) !important;
    border-radius: var(--nm-radius);
    padding: 14px 24px;
}

.nm-fluent-form .ff-btn-submit:hover {
    background: var(--nm-primary-hover) !important;
}
