/* Login tabs moderno e responsive - MOBILE FIX SICURO */

.ma-login-container {
    width: 450px;
    max-width: 450px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
}

/* Tabs Navigation */
.ma-tabs-nav {
    display: flex;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    position: relative;
}

.ma-tab-btn {
    flex: 1;
    padding: 1.2rem 1rem;
    border: none;
    background: transparent;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ma-tab-btn:hover {
    color: #495057;
    background: rgba(20,141,70,0.08);
}

.ma-tab-btn.active {
    color: #148d46;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.ma-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #148d46, #0f6b35);
    border-radius: 3px 3px 0 0;
}

/* Tab Content */
.ma-tab-content {
    display: none;
    padding: 2.5rem 2rem;
    animation: fadeIn 0.3s ease-in-out;
}

.ma-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styling */
.ma-form-group {
    margin-bottom: 1.5rem;
}

.ma-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.ma-form-group input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: #fafbfc;
    font-weight: 500;
}

.ma-form-group input:focus {
    outline: none;
    border-color: #148d46;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(20,141,70,0.15);
    transform: translateY(-1px);
}

.ma-form-group input:valid {
    border-color: #28a745;
}

.ma-form-group input::placeholder {
    color: #8a9ba8;
    font-weight: 500;
}

/* Checkbox Group */
.ma-checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.ma-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    color: #495057;
    font-weight: 500;
}

.ma-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #148d46;
    margin: 0;
}

.ma-link {
    color: #148d46;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.ma-link:hover {
    color: #0f6b35;
    text-decoration: underline;
}

/* Buttons Principali */
.ma-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ma-btn-primary {
    background: linear-gradient(135deg, #148d46 0%, #0f6b35 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(20,141,70,0.3);
}

.ma-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0f6b35 0%, #0c5529 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20,141,70,0.4);
}

.ma-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ma-loading {
    display: none;
}

.ma-btn.loading .ma-btn-text {
    display: none;
}

.ma-btn.loading .ma-loading {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Messages */
.ma-message {
    margin-bottom: 1.5rem;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 4px solid;
}

.ma-message.error {
    background: #fff5f5;
    color: #c53030;
    border-color: #fc8181;
}

.ma-message.success {
    background: #f0fff4;
    color: #2f855a;
    border-color: #68d391;
}

/* Social Login */
.ma-social-login {
    margin-top: 2rem;
}

.ma-divider {
    text-align: center;
    margin: 2rem 0 1.5rem;
    position: relative;
    color: #8a9ba8;
    font-size: 0.9rem;
    font-weight: 500;
}

.ma-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef 20%, #e9ecef 80%, transparent);
}

.ma-divider span {
    background: white;
    padding: 0 1.5rem;
    position: relative;
}

.ma-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Pulsanti Social */
.ma-social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #495057;
    transition: transform 0.2s ease;
    text-decoration: none;
}

.ma-social-login-btn:hover {
    transform: scale(1.02);
}

.ma-social-login-btn:active {
    transform: scale(0.98);
}

.ma-form-note {
    margin-top: 1.5rem;
    text-align: center;
    color: #8a9ba8;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ===== RESPONSIVE DESIGN - APPROCCIO SICURO ===== */

/* Tablet */
@media (max-width: 768px) {
    .ma-login-container {
        width: 400px;
        max-width: calc(100vw - 40px); /* Rispetta sempre i margini del viewport */
        margin: 1rem auto;
    }
    
    .ma-tab-content {
        padding: 2rem 1.5rem;
    }
    
    .ma-form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .ma-checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .ma-login-container {
        width: auto; /* CAMBIATO: larghezza automatica */
        max-width: calc(100vw - 20px); /* 10px margine per lato */
        margin: 1rem 10px; /* Margini fissi minimi */
    }
    
    .ma-tab-content {
        padding: 1.5rem 1rem;
    }
    
    .ma-tab-btn {
        padding: 0.9rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .ma-form-group input {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
}

/* Mobile molto piccolo */
@media (max-width: 360px) {
    .ma-login-container {
        width: auto; /* CAMBIATO: larghezza automatica */
        max-width: calc(100vw - 16px); /* 8px margine per lato */
        margin: 0.5rem 8px; /* Margini fissi minimi */
    }
    
    .ma-tab-content {
        padding: 1rem 0.8rem;
    }
    
    .ma-social-login-btn {
        padding: 0.8rem 0.8rem;
        font-size: 0.85rem;
        gap: 0.6rem;
    }
    
    .ma-social-login-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Mobile Landscape */
@media (max-width: 640px) and (orientation: landscape) {
    .ma-login-container {
        width: auto; /* CAMBIATO: larghezza automatica */
        max-width: calc(100vw - 30px); /* 15px margine per lato */
        margin: 0.5rem 15px; /* Margini fissi */
    }
    
    .ma-tab-content {
        padding: 1rem;
    }
}

/* OVERRIDE SOLO SE NECESSARIO: Neutralizza interferenze Astra */
@media (max-width: 480px) {
    /* Reset eventuali padding/margin Astra sui container padre */
    .woocommerce .woocommerce-MyAccount-content,
    .woocommerce-page .woocommerce-MyAccount-content,
    .site-content .entry-content,
    .ast-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Assicura che ma-login-container possa usare tutto lo spazio disponibile */
    .ma-login-container {
        box-sizing: border-box !important;
        overflow: visible !important;
    }
}